/* ==========================================================================
   THE CANN LAB - EXECUTIVE ERP & CRM SYSTEM STYLES
   Designed with Obsidian, Emerald & Gold Executive Aesthetic
   ========================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Montserrat', sans-serif;
  --font-tech: 'Orbitron', monospace;

  /* Executive Obsidian Palette */
  --erp-bg-base: #060908;
  --erp-bg-sidebar: #0A0E0C;
  --erp-bg-card: #111715;
  --erp-bg-card-hover: #16201C;
  --erp-bg-input: #0D1311;
  --erp-border: rgba(255, 255, 255, 0.08);
  --erp-border-hover: rgba(0, 229, 153, 0.3);

  --erp-emerald: #00E599;
  --erp-emerald-dark: #00B377;
  --erp-emerald-glow: rgba(0, 229, 153, 0.25);
  --erp-gold: #D4AF37;
  --erp-cyan: #00F0FF;
  --erp-danger: #FF4D4D;
  --erp-warning: #F59E0B;
  --erp-info: #3B82F6;

  --erp-text-main: #FFFFFF;
  --erp-text-sub: rgba(255, 255, 255, 0.72);
  --erp-text-dim: rgba(255, 255, 255, 0.42);

  --erp-radius-sm: 6px;
  --erp-radius-md: 10px;
  --erp-radius-lg: 16px;
  --erp-radius-full: 9999px;

  --sidebar-width: 260px;
  --header-height: 64px;
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body.admin-body {
  font-family: var(--font-sans);
  background: var(--erp-bg-base);
  color: var(--erp-text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
  transition: all var(--transition);
}

/* ==========================================================================
   AUTHENTICATION OVERLAY GATE
   ========================================================================== */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 5, 0.96);
  backdrop-filter: blur(20px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.auth-gate-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-gate-card {
  background: var(--erp-bg-card);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 2.5rem 2.2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(0, 229, 153, 0.12);
  text-align: center;
  position: relative;
}

.auth-gate-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.auth-logo {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9));
}

.auth-portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--erp-emerald);
  background: rgba(0, 229, 153, 0.1);
  padding: 0.2rem 0.65rem;
  border-radius: var(--erp-radius-full);
  border: 1px solid rgba(0, 229, 153, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 0.45rem;
}

.auth-subtitle {
  font-size: 0.82rem;
  color: var(--erp-text-sub);
  line-height: 1.5;
  margin-bottom: 1.6rem;
}

.auth-form {
  text-align: left;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--erp-text-sub);
  margin-bottom: 0.4rem;
}

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

.input-icon {
  position: absolute;
  left: 12px;
  font-size: 0.9rem;
  color: var(--erp-text-dim);
}

.form-input {
  width: 100%;
  padding: 0.7rem 0.9rem 0.7rem 2.4rem;
  background: var(--erp-bg-input);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
  color: #FFFFFF;
  font-size: 0.86rem;
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus {
  border-color: var(--erp-emerald);
  box-shadow: 0 0 10px rgba(0, 229, 153, 0.2);
}

.demo-login-hint {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--erp-radius-sm);
  padding: 0.75rem 0.85rem;
  font-size: 0.72rem;
  color: var(--erp-gold);
  line-height: 1.45;
  margin-bottom: 1.4rem;
}

.demo-badge {
  font-weight: 700;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-erp-primary {
  background: linear-gradient(135deg, #00E599 0%, #00B377 100%);
  color: #060908;
  font-weight: 700;
  padding: 0.75rem 1.4rem;
  border-radius: var(--erp-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.86rem;
}

.btn-erp-primary:hover {
  background: linear-gradient(135deg, #1DF6AC 0%, #00C785 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 229, 153, 0.35);
}

.btn-erp-outline {
  background: rgba(255, 255, 255, 0.04);
  color: #FFFFFF;
  border: 1px solid var(--erp-border);
  padding: 0.75rem 1.4rem;
  border-radius: var(--erp-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.btn-erp-outline:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.76rem;
}

.auth-back-link {
  font-size: 0.76rem;
  color: var(--erp-text-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-back-link:hover {
  color: var(--erp-emerald);
}

/* ==========================================================================
   MAIN APPLICATION SHELL & SIDEBAR
   ========================================================================== */
.erp-app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--erp-bg-base);
}

.erp-sidebar {
  width: var(--sidebar-width);
  background: var(--erp-bg-sidebar);
  border-right: 1px solid var(--erp-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: width var(--transition);
}

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

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo-img {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9));
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.62rem;
  color: var(--erp-gold);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-collapse-btn {
  color: var(--erp-text-dim);
  font-size: 0.88rem;
  padding: 0.35rem;
  border-radius: 4px;
}

.sidebar-collapse-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-section-title {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--erp-text-dim);
  letter-spacing: 0.1em;
  padding: 0.75rem 0.6rem 0.35rem;
}

.sidebar-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--erp-radius-sm);
  color: var(--erp-text-sub);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  position: relative;
}

.sidebar-nav-item i {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
  color: var(--erp-text-dim);
  transition: color var(--transition);
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #FFFFFF;
}

.sidebar-nav-item:hover i {
  color: var(--erp-emerald);
}

.sidebar-nav-item.active {
  background: rgba(0, 229, 153, 0.12);
  color: #FFFFFF;
  border: 1px solid rgba(0, 229, 153, 0.25);
}

.sidebar-nav-item.active i {
  color: var(--erp-emerald);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  padding: 0.15rem 0.45rem;
  border-radius: var(--erp-radius-full);
}

.nav-badge.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--erp-warning);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

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

.admin-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--erp-radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--erp-border);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 229, 153, 0.15);
  color: var(--erp-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
}

.user-role {
  font-size: 0.65rem;
  color: var(--erp-text-dim);
}

.logout-btn {
  color: var(--erp-text-dim);
  font-size: 0.88rem;
  padding: 0.35rem;
}

.logout-btn:hover {
  color: var(--erp-danger);
}

/* ==========================================================================
   TOP WORKSPACE HEADER
   ========================================================================== */
.erp-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

.erp-top-header {
  height: var(--header-height);
  background: var(--erp-bg-sidebar);
  border-bottom: 1px solid var(--erp-border);
  padding: 0 1.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.mobile-nav-toggle {
  display: none;
  font-size: 1.2rem;
  color: #FFFFFF;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--erp-text-dim);
}

.breadcrumb-sep {
  font-size: 0.65rem;
}

.current-crumb {
  color: #FFFFFF;
  font-weight: 700;
}

.header-center {
  flex: 1;
  max-width: 480px;
}

.global-search-box {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.global-search-box .search-icon {
  position: absolute;
  left: 12px;
  color: var(--erp-text-dim);
  font-size: 0.85rem;
}

.global-search-box input {
  width: 100%;
  padding: 0.55rem 4rem 0.55rem 2.2rem;
  background: var(--erp-bg-base);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-full);
  color: #FFFFFF;
  font-size: 0.82rem;
  outline: none;
}

.global-search-box input:focus {
  border-color: var(--erp-emerald);
}

.search-hotkey {
  position: absolute;
  right: 12px;
  font-size: 0.65rem;
  color: var(--erp-text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--erp-radius-full);
  background: rgba(0, 229, 153, 0.08);
  border: 1px solid rgba(0, 229, 153, 0.2);
  color: var(--erp-emerald);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--erp-emerald);
  box-shadow: 0 0 8px var(--erp-emerald);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--erp-radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--erp-border);
  color: var(--erp-text-sub);
  font-size: 0.78rem;
  font-weight: 600;
}

.header-action-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #FFFFFF;
}

/* ==========================================================================
   CONTENT VIEWPORT & TABS
   ========================================================================== */
.erp-content-viewport {
  padding: 2rem 2.2rem;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ==========================================================================
   METRIC KPI CARDS
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--erp-bg-card);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-md);
  padding: 1.4rem;
  transition: all var(--transition);
}

.metric-card:hover {
  border-color: var(--erp-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

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

.metric-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--erp-text-sub);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--erp-radius-full);
}

.badge-positive {
  background: rgba(0, 229, 153, 0.15);
  color: var(--erp-emerald);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--erp-info);
}

.badge-gold {
  background: rgba(212, 175, 55, 0.15);
  color: var(--erp-gold);
}

.badge-emerald {
  background: rgba(0, 229, 153, 0.15);
  color: var(--erp-emerald);
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.metric-footnote {
  font-size: 0.72rem;
  color: var(--erp-text-dim);
}

/* Quick Action Strip */
.quick-action-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.8rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--erp-border);
}

/* Dashboard Panels & Split Grid */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-panel {
  background: var(--erp-bg-card);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-md);
  overflow: hidden;
}

.panel-header {
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--erp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: #FFFFFF;
}

.panel-subtitle {
  font-size: 0.74rem;
  color: var(--erp-text-dim);
  margin-top: 0.15rem;
}

.panel-body {
  padding: 1.4rem;
}

.tag-pill {
  font-size: 0.68rem;
  color: var(--erp-text-sub);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.6rem;
  border-radius: var(--erp-radius-full);
  border: 1px solid var(--erp-border);
}

/* Analytics Chart SVG */
.analytics-chart-container {
  width: 100%;
}

.analytics-svg {
  width: 100%;
  height: 200px;
  overflow: visible;
}

.chart-labels-row {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-size: 0.7rem;
  color: var(--erp-text-dim);
}

/* Alerts Stream */
.alerts-stream-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.alert-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--erp-radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--erp-emerald);
  font-size: 0.78rem;
  color: var(--erp-text-sub);
  line-height: 1.45;
}

.alert-item.alert-gold {
  border-left-color: var(--erp-gold);
}

.alert-item.alert-info {
  border-left-color: var(--erp-info);
}

.alert-item.alert-warning {
  border-left-color: var(--erp-warning);
}

.alert-time {
  font-size: 0.68rem;
  color: var(--erp-text-dim);
  margin-top: 0.2rem;
}

/* ==========================================================================
   DATA TABLES
   ========================================================================= */
.table-responsive {
  overflow-x: auto;
}

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

.erp-table th {
  padding: 0.85rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--erp-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--erp-border);
  background: rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

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

.erp-table tbody tr:hover td {
  background: var(--erp-bg-card-hover);
  color: #FFFFFF;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--erp-radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-badge.status-paid,
.status-badge.status-delivered,
.status-badge.status-active {
  background: rgba(0, 229, 153, 0.15);
  color: var(--erp-emerald);
  border: 1px solid rgba(0, 229, 153, 0.3);
}

.status-badge.status-processing,
.status-badge.status-dispatched {
  background: rgba(59, 130, 246, 0.15);
  color: var(--erp-info);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--erp-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.status-pickedup {
  background: rgba(212, 175, 55, 0.15);
  color: var(--erp-gold);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.status-badge.status-low {
  background: rgba(255, 77, 77, 0.15);
  color: var(--erp-danger);
  border: 1px solid rgba(255, 77, 77, 0.3);
}

/* Action Buttons inside Table Cells */
.action-btn-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.table-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--erp-border);
  color: var(--erp-text-sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}

.table-action-btn:hover {
  background: var(--erp-emerald);
  color: #060908;
  border-color: var(--erp-emerald);
}

/* ==========================================================================
   PAGE HEADERS & FILTERS
   ========================================================================== */
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: #FFFFFF;
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--erp-text-dim);
  margin-top: 0.15rem;
}

.page-actions-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.table-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  background: var(--erp-bg-card);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--erp-text-dim);
}

.filter-select,
.filter-input {
  background: var(--erp-bg-input);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-sm);
  color: #FFFFFF;
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  outline: none;
}

.filter-group.search-filter-box {
  margin-left: auto;
  flex: 1;
  max-width: 320px;
}

.filter-group.search-filter-box .filter-input {
  width: 100%;
}

/* Category Breakdown Bars */
.category-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.cat-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.cat-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--erp-radius-full);
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  background: var(--erp-emerald);
  border-radius: var(--erp-radius-full);
}

.summary-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--erp-border);
  font-size: 0.84rem;
  color: var(--erp-text-sub);
}

.summary-stat-row:last-child {
  border-bottom: none;
}

/* ==========================================================================
   MODALS: CREATE ORDER, ADD PRODUCT, VIEW ORDER, ETC.
   ========================================================================== */
.erp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 5, 0.85);
  backdrop-filter: blur(14px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.erp-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.erp-modal-box {
  background: var(--erp-bg-card);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
}

.modal-close-btn {
  color: var(--erp-text-dim);
  font-size: 1.1rem;
}

.modal-close-btn:hover {
  color: #FFFFFF;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

/* ==========================================================================
   PRINT STYLES FOR WAYBILLS & PACKING SLIPS
   ========================================================================== */
@media print {
  .erp-sidebar,
  .erp-top-header,
  .quick-action-strip,
  .page-actions-group,
  .table-filter-bar {
    display: none !important;
  }
  .erp-main-area {
    height: auto !important;
    overflow: visible !important;
  }
  body.admin-body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1100px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .erp-sidebar {
    position: fixed;
    left: -260px;
    transition: left var(--transition);
  }
  .erp-sidebar.mobile-open {
    left: 0;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .header-center {
    display: none;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .erp-content-viewport {
    padding: 1.25rem 1rem;
  }
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}
