/* ==========================================================================
   BusinessFlex - Premium Commercial SaaS Design System
   Modern, colourful, accessible, responsive, and friendly for everyday business.
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Brand & Core Action Colors (Vibrant Green & Warm Orange) */
  --color-brand: #059669;
  --color-brand-hover: #047857;
  --color-brand-light: #ecfdf5;
  --color-brand-border: #a7f3d0;
  --color-orange: #ea580c;
  --color-orange-hover: #c2410c;
  --color-orange-light: #fff7ed;
  --color-orange-border: #fed7aa;

  --color-primary: #0f172a;
  --color-primary-dark: #0f172a;

  /* Module & Functional Visual Identities */
  /* Sales & POS (Lush Emerald Green) */
  --module-sales: #059669;
  --module-sales-bg: #ecfdf5;
  --module-sales-border: #a7f3d0;

  /* Stock & Inventory (Warm Amber/Orange) */
  --module-stock: #ea580c;
  --module-stock-bg: #fff7ed;
  --module-stock-border: #fed7aa;

  /* Expenses & Money Out (Rose/Red) */
  --module-expenses: #e11d48;
  --module-expenses-bg: #fff1f2;
  --module-expenses-border: #fecdd3;

  /* Customers Owing / Credit (Cyan/Sky) */
  --module-customers: #0891b2;
  --module-customers-bg: #ecfeff;
  --module-customers-border: #a5f3fc;

  /* Suppliers & Procurement (Orange) */
  --module-suppliers: #ea580c;
  --module-suppliers-bg: #fff7ed;
  --module-suppliers-border: #fed7aa;

  /* Cash & Drawer (Teal / Blue-Green) */
  --module-cash: #0d9488;
  --module-cash-bg: #f0fdfa;
  --module-cash-border: #99f6e4;

  /* Staff & Team (Violet/Purple) */
  --module-team: #7c3aed;
  --module-team-bg: #f5f3ff;
  --module-team-border: #ddd6fe;

  /* Reports & Profit Insights (Purple/Indigo) */
  --module-reports: #9333ea;
  --module-reports-bg: #faf5ff;
  --module-reports-border: #e9d5ff;

  /* Storefront & Ecommerce (Indigo) */
  --module-storefront: #6366f1;
  --module-storefront-bg: #eef2ff;
  --module-storefront-border: #c7d2fe;

  /* Status Colors */
  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;

  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;

  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;

  --color-info: #0284c7;
  --color-info-bg: #f0f9ff;
  --color-info-border: #bae6fd;

  /* Surfaces, Backgrounds & Borders */
  --color-bg: #f8fafc;
  --color-card-bg: #ffffff;
  --color-card-subtle: #f8fafc;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;

  /* Layout Dimensions */
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 72px;
  --header-height: 4rem;
  --mobile-nav-height: 4rem;
  --max-width: 1200px;

  /* Sizing & Geometry */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Layered Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.07), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --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.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px -3px rgba(37, 99, 235, 0.2);
}

/* Reset & Global Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary-dark);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.15rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin-bottom: 0.75rem; color: var(--color-text); }
a { color: var(--color-brand); text-decoration: none; font-weight: 500; transition: color 0.15s; }
a:hover { color: var(--color-brand-hover); text-decoration: none; }

/* Global Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.workspace-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   App Header & Top Navigation
   ========================================================================== */
.app-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.app-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ea580c 0%, #f97316 25%, #10b981 65%, #059669 100%);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1.5rem;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--color-primary-dark);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--color-primary-dark);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  background: linear-gradient(135deg, #ea580c 0%, #10b981 100%);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
}

.brand-text {
  font-weight: 800;
}

.tenant-badge {
  background-color: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Header Global Search */
.header-search-wrapper {
  flex: 1;
  max-width: 440px;
}

.header-search-form {
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.85rem;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.header-search-form:focus-within {
  background: #ffffff;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-icon {
  font-size: 0.9rem;
  margin-right: 0.45rem;
  color: var(--color-text-muted);
}

.header-search-input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 0.88rem;
  color: var(--color-text);
  outline: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}

.header-action-btn.pos-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.header-action-btn.pos-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.header-action-btn.store-btn {
  background: var(--module-storefront-bg);
  color: var(--module-storefront);
  border: 1px solid var(--module-storefront-border);
}

.header-action-btn.store-btn:hover {
  background: #e0e7ff;
}

.header-user-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.25rem;
}

.user-profile-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.user-role-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
}

.logout-btn {
  padding: 0.28rem 0.65rem;
  font-size: 0.8rem;
}

/* ==========================================================================
   Workspace Layout Shell & Desktop Sidebar
   ========================================================================== */
.workspace-layout-container {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--header-height));
}

.app-sidebar {
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 90;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-primary-dark);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-toggle-btn {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  transition: background 0.15s;
}

.sidebar-toggle-btn:hover {
  background: var(--color-border);
}

.sidebar-nav {
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-light);
  padding: 0.65rem 0.65rem 0.25rem 0.65rem;
  user-select: none;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: all 0.15s ease;
}

.sidebar-nav-item:hover {
  background-color: var(--color-bg);
  color: var(--color-brand);
}

.sidebar-nav-item.active {
  background-color: var(--color-brand-light);
  color: var(--color-brand);
  font-weight: 700;
}

.sidebar-nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3.5px;
  background-color: var(--color-brand);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.sidebar-nav-item[data-module="pos"].active {
  background-color: var(--module-sales-bg);
  color: var(--module-sales);
}
.sidebar-nav-item[data-module="pos"].active::before {
  background-color: var(--module-sales);
}

.sidebar-nav-item .nav-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav-item .nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav-item .nav-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--module-sales-bg);
  color: var(--module-sales);
  border: 1px solid var(--module-sales-border);
}

.sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.sidebar-trial-badge {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

/* Collapsed Sidebar Mode */
.app-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.app-sidebar.collapsed .sidebar-brand-text,
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .nav-pill,
.app-sidebar.collapsed .nav-group-label,
.app-sidebar.collapsed .sidebar-trial-badge {
  display: none;
}

.app-sidebar.collapsed .sidebar-toggle-btn .toggle-icon {
  transform: rotate(180deg);
}

.app-sidebar.collapsed .sidebar-nav-item {
  justify-content: center;
  padding: 0.6rem 0;
}

.app-sidebar.collapsed .sidebar-nav-item .nav-icon {
  margin: 0;
}

/* Workspace Main Content Area */
.workspace-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--color-bg);
}

main.main-content {
  flex: 1;
  padding: 1.75rem 0;
}

/* Footer */
.footer {
  background-color: #ffffff;
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: auto;
}

/* ==========================================================================
   Mobile Bottom Navigation & Responsive Breakpoints
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-height);
  background: #ffffff;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  flex: 1;
  padding: 0.35rem 0;
}

.mobile-nav-item.active {
  color: var(--color-brand);
  font-weight: 700;
}

.mobile-nav-icon {
  font-size: 1.25rem;
}

.pos-fab-item {
  position: relative;
  top: -0.6rem;
}

.pos-fab-circle {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
  border: 3px solid #ffffff;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 95;
}

@media (max-width: 900px) {
  .header-search-wrapper {
    display: none;
  }

  .header-mobile-menu-btn {
    display: inline-flex;
  }

  .app-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: 270px;
    z-index: 110;
    box-shadow: var(--shadow-xl);
    transition: left 0.25s ease;
  }

  .app-sidebar.mobile-open {
    left: 0;
  }

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

  .mobile-bottom-nav {
    display: flex;
  }

  body.has-workspace-layout {
    padding-bottom: var(--mobile-nav-height);
  }
}

/* ==========================================================================
   Cards & Surfaces
   ========================================================================== */
.card {
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--color-border-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.4;
  user-select: none;
}

.btn:disabled, .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-orange {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}

.btn-orange:hover:not(:disabled) {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--color-primary-dark);
  border-color: var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-bg);
  border-color: var(--color-border-hover);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
}

.btn-danger {
  background-color: var(--color-danger);
  color: #ffffff;
  border-color: var(--color-danger);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* Button Loading Spinner */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.5em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  line-height: 1.2;
}

.badge-success {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.badge-warning {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge-danger {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.badge-info {
  background-color: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--color-info-border);
}

.badge-neutral {
  background-color: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* ==========================================================================
   Dashboard & Metric Cards (Core System)
   ========================================================================== */
.stats-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  gap: 1.25rem !important;
  margin-bottom: 1.5rem !important;
}

.stat-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  padding: 1.4rem 1.5rem !important;
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.05) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  position: relative !important;
  overflow: hidden !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.stat-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 14px 28px -4px rgba(15, 23, 42, 0.1), 0 8px 12px -6px rgba(15, 23, 42, 0.05) !important;
}

.stat-card-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 0.65rem !important;
}

.stat-label {
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.stat-icon {
  font-size: 1.35rem !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

.stat-value {
  font-size: 2rem !important;
  font-weight: 900 !important;
  color: #0f172a !important;
  margin: 0.25rem 0 !important;
  letter-spacing: -0.03em !important;
}

.trend-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.3rem !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  padding: 0.22rem 0.6rem !important;
  border-radius: 9999px !important;
}

.trend-up {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
}

.trend-down {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
}

.trend-neutral {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
}

.quick-action-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  padding: 1.2rem 1.35rem !important;
  text-decoration: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 1rem !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.quick-action-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.09) !important;
  border-color: #cbd5e1 !important;
}

.quick-action-icon {
  font-size: 1.65rem !important;
  width: 48px !important;
  height: 48px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
  width: 100%;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-primary-dark);
  margin-bottom: 0.4rem;
}

.form-input,
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="search"],
select,
textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--color-text);
  background-color: #ffffff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-error {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--color-danger);
  margin-top: 0.35rem;
}

.form-help,
.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.35rem;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.table th {
  background-color: var(--color-bg);
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: rgba(248, 250, 252, 0.75);
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.alert-success {
  background-color: var(--color-success-bg);
  color: #065f46;
  border: 1px solid var(--color-success-border);
}

.alert-warning {
  background-color: var(--color-warning-bg);
  color: #92400e;
  border: 1px solid var(--color-warning-border);
}

.alert-danger {
  background-color: var(--color-danger-bg);
  color: #991b1b;
  border: 1px solid var(--color-danger-border);
}

.alert-info {
  background-color: var(--color-info-bg);
  color: #075985;
  border: 1px solid var(--color-info-border);
}

/* ==========================================================================
   Contextual Empty State Component
   ========================================================================== */
.empty-state-card {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: #ffffff;
  border: 1px dashed var(--color-border-hover);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}

.empty-state-desc {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.6;
}

/* ==========================================================================
   Modern Landing Page & Public Auth Design System
   ========================================================================== */
.landing-hero-wrapper {
  padding: 4.5rem 1.5rem 3.5rem 1.5rem;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.08) 0%, rgba(234, 88, 12, 0.04) 40%, rgba(248, 250, 252, 0) 70%);
  border-radius: var(--radius-xl);
  margin-bottom: 3.5rem;
}

.landing-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #ea580c;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.08);
  margin-bottom: 1.5rem;
}

.landing-hero-headline {
  font-size: 3.4rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 860px;
  margin: 0 auto 1.25rem auto;
}

.text-gradient {
  background: linear-gradient(135deg, #ea580c 0%, #16a34a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-hero-subtitle {
  font-size: 1.2rem;
  color: #475569;
  max-width: 700px;
  margin: 0 auto 2.25rem auto;
  line-height: 1.6;
}

.landing-cta-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.landing-trust-pills {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  flex-wrap: wrap;
}

/* Feature Grid Cards */
.feature-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-bottom: 4rem;
}

.feature-box-modern {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.feature-box-modern:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  border-color: var(--color-brand-border);
}

.feature-box-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}

/* Split Screen Auth Layout */
.auth-split-container {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  min-height: 640px;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  margin: 2rem auto 4rem auto;
  max-width: 1060px;
  position: relative;
}

.auth-split-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ea580c 0%, #f97316 25%, #10b981 65%, #059669 100%);
  z-index: 10;
}

@media (max-width: 920px) {
  .auth-split-container {
    grid-template-columns: 1fr;
  }
  .auth-branding-sidebar {
    display: none;
  }
  .landing-hero-headline {
    font-size: 2.2rem;
  }
}

.auth-branding-sidebar {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 3.5rem 2.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  border-right: 1px solid #334155;
}

.auth-branding-sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.2) 0%, rgba(234, 88, 12, 0.1) 40%, transparent 70%);
  pointer-events: none;
}

.auth-form-panel {
  padding: 3.5rem 3rem;
  background: #ffffff;
}

.auth-perk-item {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  margin-bottom: 1.35rem;
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.auth-perk-check {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.4);
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

