/* ==============================================================================
   MyBiz Vehicle Dealership ERP SaaS - Commercial Design System (v2.0 Phase 4)
   Modular Tokens, Components, Layout, Accessibility & Print
   ============================================================================== */
@import url('tokens.css');
@import url('base.css');
@import url('layout.css');
@import url('components.css');
@import url('utilities.css');
@import url('pages/platform.css');
@import url('pages/workspace.css');
@import url('print.css');

:root {
  /* Color Palette Mapped to Tokens */
  --primary: var(--color-primary-600, #2563eb);
  --primary-hover: var(--color-primary-700, #1d4ed8);
  --primary-light: var(--color-primary-50, #eff6ff);
  --primary-dark: var(--color-primary-800, #1e40af);
  
  --secondary: #475569;
  --secondary-light: #f1f5f9;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  
  --info: #0ea5e9;
  --info-light: #f0f9ff;
  
  --dark: #0f172a;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white:     #ffffff;

  /* Typography */
  --font-sans: 'Noto Sans Myanmar', 'Pyidaungsu', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.08);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, button, input, select, textarea {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--slate-800);
  background-color: var(--slate-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-hover);
}

/* App Layout Structure */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--slate-900);
  color: var(--slate-300);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: #090d16;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}

.sidebar-brand .badge-saas {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  font-weight: 700;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.menu-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--slate-500);
  padding: 12px 12px 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--slate-300);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.menu-item.active {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}

.menu-item svg, .menu-item i {
  width: 18px;
  height: 18px;
  opacity: 0.85;
  flex-shrink: 0;
  text-align: center;
}

.menu-item.active svg, .menu-item.active i {
  opacity: 1;
}

/* Collapsible Nav Group & Submenus */
.nav-group {
  margin-bottom: 2px;
}

.nav-group-toggle {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--slate-300);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13.5px;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  text-align: left;
  user-select: none;
}

.nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.nav-group.open > .nav-group-toggle {
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
}

.nav-group-toggle .chevron-icon {
  margin-left: auto;
  font-size: 11px;
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.nav-group.open > .nav-group-toggle .chevron-icon {
  transform: rotate(90deg);
  opacity: 1;
  color: #60a5fa;
}

.nav-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  overflow: hidden;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  margin-left: 20px;
  margin-top: 2px;
  margin-bottom: 4px;
}

.nav-group.open > .nav-submenu {
  display: block;
}

.nav-subitem {
  display: block;
  padding: 7px 12px 7px 14px;
  color: #94a3b8;
  font-size: 12.8px;
  font-weight: 400;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
  margin-bottom: 1px;
}

.nav-subitem:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  padding-left: 17px;
}

.nav-subitem.active {
  color: #60a5fa;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.15);
  border-left: 2px solid #3b82f6;
  padding-left: 14px;
}

.menu-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.menu-badge-warning {
  background: var(--warning);
  color: #78350f;
}

/* Main Content Wrapper */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar Header */
.app-topbar {
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.tenant-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
}

.tenant-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
}

.branch-select {
  font-size: 12.5px;
  padding: 4px 10px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--slate-700);
  outline: none;
}

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

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.user-profile-menu:hover {
  background: var(--slate-100);
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4338ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-info .user-name {
  font-weight: 600;
  color: var(--slate-800);
  font-size: 13px;
  line-height: 1.2;
}

.user-info .user-role {
  font-size: 11.5px;
  color: var(--slate-500);
}

/* Page Container */
.page-container {
  padding: 24px 28px;
  flex: 1;
}
.app-content > .page-container,
.app-content .page-container {
  padding: 0 !important;
}

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

.page-title h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.4px;
}

.page-title p {
  color: var(--slate-500);
  font-size: 13px;
  margin-top: 2px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Cards & Containers */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-800);
}

.card-body {
  padding: 20px;
}

/* Metric KPI Widgets */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.kpi-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon.primary { background: var(--primary-light); color: var(--primary); }
.kpi-icon.success { background: var(--success-light); color: var(--success); }
.kpi-icon.warning { background: var(--warning-light); color: var(--warning); }
.kpi-icon.danger  { background: var(--danger-light);  color: var(--danger); }

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.kpi-sub {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 6px;
}

/* Standard Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--white);
  color: var(--slate-700);
  border-color: var(--slate-300);
}
.btn-secondary:hover {
  background: var(--slate-50);
  border-color: var(--slate-400);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Action Icon Buttons for CRUD Tables */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-600);
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  transform: translateY(-1px);
}

/* Specific CRUD & Shield Action Styles */
.action-view:hover {
  background: var(--info-light);
  color: var(--info);
  border-color: #bae6fd;
}

.action-edit:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}

.action-delete:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #fecaca;
}

.action-shield:hover {
  background: #fdf4ff;
  color: #a855f7;
  border-color: #f0abfc;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  background: var(--slate-50);
  color: var(--slate-600);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-200);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--slate-200);
  font-size: 13.5px;
  color: var(--slate-700);
  vertical-align: middle;
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-success { background: var(--success-light); color: #065f46; border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-light); color: #92400e; border: 1px solid var(--warning-border); }
.badge-danger  { background: var(--danger-light);  color: #991b1b; border: 1px solid var(--danger-border); }
.badge-info    { background: var(--info-light);    color: #075985; border: 1px solid #bae6fd; }
.badge-secondary { background: var(--slate-100);   color: var(--slate-700); border: 1px solid var(--slate-300); }

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--slate-800);
  background: var(--white);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Live Search Bar */
.search-filter-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
}

.search-input-wrapper input {
  padding-left: 38px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success { background: var(--success-light); color: #065f46; border: 1px solid var(--success-border); }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border: 1px solid var(--danger-border); }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid var(--warning-border); }

/* Modal */
.modal,
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active,
.modal-overlay.active {
  display: flex !important;
}

.modal-dialog {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto;
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--slate-200);
  background: var(--slate-50);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Visibility and Modal Utilities */
.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none !important;
}

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

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* -----------------------------------------------------------------------------
   Layout, Flexbox & Grid Utility Classes (Bulletproof Native Fallbacks)
   ----------------------------------------------------------------------------- */
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.flex-col { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-end { justify-content: flex-end !important; }
.justify-start { justify-content: flex-start !important; }

.gap-1 { gap: 4px !important; }
.gap-1\.5 { gap: 6px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }
.gap-6 { gap: 24px !important; }

/* Inline Forms inside Tables */
form.inline {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Action Icon Buttons */
.btn-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--slate-300) !important;
  background: var(--white) !important;
  color: var(--slate-600) !important;
  font-size: 13px !important;
  line-height: 1 !important;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-sizing: border-box;
}
.btn-action:hover {
  background: var(--slate-100) !important;
  color: var(--slate-900) !important;
  border-color: var(--slate-400) !important;
}
.btn-action.btn-view {
  color: var(--primary) !important;
  background: var(--primary-light) !important;
  border-color: #bfdbfe !important;
}
.btn-action.btn-view:hover {
  background: #dbeafe !important;
}
.btn-action.btn-edit {
  color: #d97706 !important;
  background: #fef3c7 !important;
  border-color: #fde68a !important;
}
.btn-action.btn-edit:hover {
  background: #fde68a !important;
}
.btn-action.btn-delete {
  color: var(--danger) !important;
  background: var(--danger-light) !important;
  border-color: var(--danger-border) !important;
}
.btn-action.btn-delete:hover {
  background: #fee2e2 !important;
}

/* SVG Dimension Protections (Prevents huge unstyled SVGs) */
svg.w-3, .w-3 svg, svg[class*="w-3"] { width: 12px !important; height: 12px !important; min-width: 12px; }
svg.w-4, .w-4 svg, svg[class*="w-4"] { width: 16px !important; height: 16px !important; min-width: 16px; }
svg.w-5, .w-5 svg, svg[class*="w-5"] { width: 20px !important; height: 20px !important; min-width: 20px; }
svg.w-6, .w-6 svg, svg[class*="w-6"] { width: 24px !important; height: 24px !important; min-width: 24px; }
svg.w-8, .w-8 svg, svg[class*="w-8"] { width: 32px !important; height: 32px !important; min-width: 32px; }

/* Page Titles and Headings */
.page-title,
h1.page-title,
.page-title h2 {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--slate-900) !important;
  letter-spacing: -0.4px;
}
.page-title i,
h1.page-title i,
.page-title svg,
h1.page-title svg {
  margin-right: 10px !important;
  vertical-align: middle;
}

/* Spacing and Utilities */
.mr-1 { margin-right: 4px !important; }
.mr-2 { margin-right: 8px !important; }
.mr-3 { margin-right: 12px !important; }
.mr-4 { margin-right: 16px !important; }
.ml-1 { margin-left: 4px !important; }
.ml-2 { margin-left: 8px !important; }
.ml-3 { margin-left: 12px !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-6 { margin-bottom: 24px !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-4 { margin-top: 16px !important; }

.p-4 { padding: 16px !important; }
.p-6 { padding: 24px !important; }
.px-4 { padding-left: 16px !important; padding-right: 16px !important; }
.py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-3 { padding-top: 12px !important; padding-bottom: 12px !important; }

/* Text & Alignment Utilities */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-sm { font-size: 13px !important; }
.text-xs { font-size: 11.5px !important; }
.text-lg { font-size: 18px !important; }
.text-xl { font-size: 20px !important; }
.text-2xl { font-size: 24px !important; }
.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.font-medium { font-weight: 500 !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }

/* Grid Fallback */
.grid { display: grid !important; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .md\:flex-row { flex-direction: row !important; }
  .md\:items-center { align-items: center !important; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

/* =============================================================================
   Universal 12-Column Responsive Grid System & Compatibility Framework
   Restores native alignment for .row, .col-*, .g-*, typography & borders
   ============================================================================= */
.row {
  display: flex !important;
  flex-wrap: wrap !important;
  margin-right: -12px !important;
  margin-left: -12px !important;
}

.row > * {
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  width: 100%;
  max-width: 100%;
  padding-right: 12px !important;
  padding-left: 12px !important;
}

/* Row Gutter Spacing */
.g-0 { margin-right: 0 !important; margin-left: 0 !important; }
.g-0 > * { padding-right: 0 !important; padding-left: 0 !important; }

.g-1 { margin-right: -4px !important; margin-left: -4px !important; }
.g-1 > * { padding-right: 4px !important; padding-left: 4px !important; margin-bottom: 8px !important; }

.g-2 { margin-right: -8px !important; margin-left: -8px !important; }
.g-2 > * { padding-right: 8px !important; padding-left: 8px !important; margin-bottom: 12px !important; }

.g-3 { margin-right: -12px !important; margin-left: -12px !important; }
.g-3 > * { padding-right: 12px !important; padding-left: 12px !important; margin-bottom: 16px !important; }

.g-4 { margin-right: -16px !important; margin-left: -16px !important; }
.g-4 > * { padding-right: 16px !important; padding-left: 16px !important; margin-bottom: 24px !important; }

/* Base Columns (Mobile & Default) */
.col-1  { flex: 0 0 auto !important; width: 8.33333333% !important; }
.col-2  { flex: 0 0 auto !important; width: 16.66666667% !important; }
.col-3  { flex: 0 0 auto !important; width: 25% !important; }
.col-4  { flex: 0 0 auto !important; width: 33.33333333% !important; }
.col-5  { flex: 0 0 auto !important; width: 41.66666667% !important; }
.col-6  { flex: 0 0 auto !important; width: 50% !important; }
.col-7  { flex: 0 0 auto !important; width: 58.33333333% !important; }
.col-8  { flex: 0 0 auto !important; width: 66.66666667% !important; }
.col-9  { flex: 0 0 auto !important; width: 75% !important; }
.col-10 { flex: 0 0 auto !important; width: 83.33333333% !important; }
.col-11 { flex: 0 0 auto !important; width: 91.66666667% !important; }
.col-12 { flex: 0 0 auto !important; width: 100% !important; }

/* Small (sm: >= 576px) */
@media (min-width: 576px) {
  .col-sm-2  { flex: 0 0 auto !important; width: 16.66666667% !important; }
  .col-sm-3  { flex: 0 0 auto !important; width: 25% !important; }
  .col-sm-4  { flex: 0 0 auto !important; width: 33.33333333% !important; }
  .col-sm-5  { flex: 0 0 auto !important; width: 41.66666667% !important; }
  .col-sm-6  { flex: 0 0 auto !important; width: 50% !important; }
  .col-sm-7  { flex: 0 0 auto !important; width: 58.33333333% !important; }
  .col-sm-8  { flex: 0 0 auto !important; width: 66.66666667% !important; }
  .col-sm-9  { flex: 0 0 auto !important; width: 75% !important; }
  .col-sm-12 { flex: 0 0 auto !important; width: 100% !important; }
}

/* Medium (md: >= 768px) */
@media (min-width: 768px) {
  .col-md-1  { flex: 0 0 auto !important; width: 8.33333333% !important; }
  .col-md-2  { flex: 0 0 auto !important; width: 16.66666667% !important; }
  .col-md-3  { flex: 0 0 auto !important; width: 25% !important; }
  .col-md-4  { flex: 0 0 auto !important; width: 33.33333333% !important; }
  .col-md-5  { flex: 0 0 auto !important; width: 41.66666667% !important; }
  .col-md-6  { flex: 0 0 auto !important; width: 50% !important; }
  .col-md-7  { flex: 0 0 auto !important; width: 58.33333333% !important; }
  .col-md-8  { flex: 0 0 auto !important; width: 66.66666667% !important; }
  .col-md-9  { flex: 0 0 auto !important; width: 75% !important; }
  .col-md-10 { flex: 0 0 auto !important; width: 83.33333333% !important; }
  .col-md-12 { flex: 0 0 auto !important; width: 100% !important; }
}

/* Large (lg: >= 1024px) */
@media (min-width: 1024px) {
  .col-lg-2  { flex: 0 0 auto !important; width: 16.66666667% !important; }
  .col-lg-3  { flex: 0 0 auto !important; width: 25% !important; }
  .col-lg-4  { flex: 0 0 auto !important; width: 33.33333333% !important; }
  .col-lg-5  { flex: 0 0 auto !important; width: 41.66666667% !important; }
  .col-lg-6  { flex: 0 0 auto !important; width: 50% !important; }
  .col-lg-7  { flex: 0 0 auto !important; width: 58.33333333% !important; }
  .col-lg-8  { flex: 0 0 auto !important; width: 66.66666667% !important; }
  .col-lg-9  { flex: 0 0 auto !important; width: 75% !important; }
  .col-lg-12 { flex: 0 0 auto !important; width: 100% !important; }
}

/* Extra Large (xl: >= 1200px) */
@media (min-width: 1200px) {
  .col-xl-2  { flex: 0 0 auto !important; width: 16.66666667% !important; }
  .col-xl-3  { flex: 0 0 auto !important; width: 25% !important; }
  .col-xl-4  { flex: 0 0 auto !important; width: 33.33333333% !important; }
  .col-xl-6  { flex: 0 0 auto !important; width: 50% !important; }
  .col-xl-8  { flex: 0 0 auto !important; width: 66.66666667% !important; }
  .col-xl-12 { flex: 0 0 auto !important; width: 100% !important; }
}

/* Standard Flex & Alignment Utilities */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-start { justify-content: flex-start !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.w-auto { width: auto !important; }
.h-auto { height: auto !important; }

/* Font Size & Weight Utilities */
.fs-1 { font-size: 2.25rem !important; }
.fs-2 { font-size: 1.85rem !important; }
.fs-3 { font-size: 1.5rem !important; }
.fs-4 { font-size: 1.25rem !important; }
.fs-5 { font-size: 1.1rem !important; }
.fs-6 { font-size: 0.95rem !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-medium { font-weight: 500 !important; }
.fw-normal { font-weight: 400 !important; }
.small, small { font-size: 0.85em !important; }

/* Border Thickness & Position Utilities */
.border-0 { border: 0 !important; }
.border-1 { border-width: 1px !important; }
.border-2 { border-width: 2px !important; }
.border-3 { border-width: 3px !important; }
.border-4 { border-width: 4px !important; }
.border-top { border-top-style: solid !important; }
.border-bottom { border-bottom-style: solid !important; }
.border-start { border-left-style: solid !important; }
.border-end { border-right-style: solid !important; }
.border-primary { border-color: var(--primary) !important; }
.border-success { border-color: #10b981 !important; }
.border-danger { border-color: #ef4444 !important; }
.border-warning { border-color: #f59e0b !important; }
.border-info { border-color: #0ea5e9 !important; }
.border-secondary { border-color: #94a3b8 !important; }
.border-light { border-color: #e2e8f0 !important; }

/* Subtle Background Colors */
.bg-light { background-color: #f8fafc !important; }
.bg-white { background-color: #ffffff !important; }
.bg-primary-subtle { background-color: #eff6ff !important; color: #1d4ed8 !important; }
.bg-success-subtle { background-color: #ecfdf5 !important; color: #047857 !important; }
.bg-danger-subtle { background-color: #fef2f2 !important; color: #b91c1c !important; }
.bg-warning-subtle { background-color: #fffbeb !important; color: #b45309 !important; }
.bg-info-subtle { background-color: #f0f9ff !important; color: #0369a1 !important; }

/* Rounded Corners & Shadows */
.rounded { border-radius: var(--radius-sm) !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-pill { border-radius: 9999px !important; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important; }
.shadow-none { box-shadow: none !important; }

/* Margins & Paddings (Bootstrap compatibility) */
.me-1 { margin-right: 4px !important; }
.me-2 { margin-right: 8px !important; }
.me-3 { margin-right: 16px !important; }
.me-4 { margin-right: 24px !important; }
.ms-1 { margin-left: 4px !important; }
.ms-2 { margin-left: 8px !important; }
.ms-3 { margin-left: 16px !important; }
.ms-4 { margin-left: 24px !important; }
.pb-1 { padding-bottom: 4px !important; }
.pb-2 { padding-bottom: 8px !important; }
.pb-3 { padding-bottom: 16px !important; }
.pt-1 { padding-top: 4px !important; }
.pt-2 { padding-top: 8px !important; }
.pt-3 { padding-top: 16px !important; }

/* Nav Tabs Component */
.nav-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  padding-left: 0 !important;
  margin-bottom: 20px !important;
  list-style: none !important;
  border-bottom: 1px solid var(--slate-200) !important;
  gap: 4px !important;
}

.nav-tabs .nav-item {
  margin-bottom: -1px !important;
}

.nav-tabs .nav-link {
  display: block !important;
  padding: 10px 18px !important;
  color: var(--slate-600) !important;
  text-decoration: none !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-top-left-radius: 8px !important;
  border-top-right-radius: 8px !important;
  font-weight: 500 !important;
  font-size: 13.5px !important;
  transition: var(--transition) !important;
}

.nav-tabs .nav-link:hover {
  color: var(--primary) !important;
  background: #f1f5f9 !important;
}

.nav-tabs .nav-link.active {
  color: var(--primary) !important;
  background: #ffffff !important;
  border-color: var(--slate-200) var(--slate-200) #ffffff !important;
  font-weight: 700 !important;
}

/* Close button */
.btn-close {
  background: transparent !important;
  border: 0 !important;
  font-size: 18px !important;
  cursor: pointer !important;
  opacity: 0.5 !important;
  line-height: 1 !important;
}
.btn-close:hover { opacity: 1 !important; }

/* Table enhancements */
.table-borderless th,
.table-borderless td {
  border: none !important;
}
.table-hover tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.04) !important;
}
.align-middle {
  vertical-align: middle !important;
}

/* Mobile Responsive Drawer Navigation */
@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: 100;
  }
  body.sidebar-open .app-sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .app-topbar {
    padding: 0 16px !important;
  }
  .mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 95;
  }
  body.sidebar-open .mobile-drawer-overlay {
    display: block;
  }
/* =============================================================================
   Strict Visibility Enforcement
   Must strictly supersede any display property (.flex, .d-flex, .grid, .block, etc.)
   ============================================================================= */
.hidden,
[hidden],
.d-none,
div.hidden,
section.hidden,
form.hidden,
*.hidden,
.modal-backdrop.hidden,
.modal.hidden,
div[id^="modal-"].hidden,
div[id*="Modal"].hidden,
div[id*="modal"].hidden {
  display: none !important;
}



