/* ============================================================
   Courier Management System — Modern Enterprise Logistics Design System
   Refined Theme: Deep Slate & Vibrant Indigo Accent
   Typography: Plus Jakarta Sans & JetBrains Mono
   ============================================================ */

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

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

:root {
  /* ── Brand Colors ── */
  --primary:         #2563eb;
  --primary-hover:   #1d4ed8;
  --primary-dark:    #1e40af;
  --primary-light:   #eff6ff;
  --primary-border:  #bfdbfe;
  --primary-subtle:  rgba(37, 99, 235, 0.08);

  /* ── Accent & Semantic Colors ── */
  --secondary:       #10b981;
  --secondary-hover: #059669;
  --secondary-light: #ecfdf5;
  --secondary-border:#a7f3d0;
  --secondary-text:  #065f46;

  --danger:          #ef4444;
  --danger-hover:    #dc2626;
  --danger-light:    #fef2f2;
  --danger-border:   #fecaca;
  --danger-text:     #991b1b;

  --warning:         #f59e0b;
  --warning-hover:   #d97706;
  --warning-light:   #fffbeb;
  --warning-border:  #fde68a;
  --warning-text:    #92400e;

  --info:            #0ea5e9;
  --info-hover:      #0284c7;
  --info-light:      #f0f9ff;
  --info-border:     #bae6fd;
  --info-text:       #0369a1;

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

  /* ── Neutrals (Slate Scale) ── */
  --gray-50:         #f8fafc;
  --gray-100:        #f1f5f9;
  --gray-200:        #e2e8f0;
  --gray-300:        #cbd5e1;
  --gray-400:        #94a3b8;
  --gray-500:        #64748b;
  --gray-600:        #475569;
  --gray-700:        #334155;
  --gray-800:        #1e293b;
  --gray-900:        #0f172a;
  --gray-950:        #020617;

  /* ── Layout Sizes ── */
  --sidebar-w:       260px;
  --sidebar-w-mini:  72px;
  --header-h:        66px;

  /* ── Typography ── */
  --font:            'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:       'JetBrains Mono', monospace;

  /* ── Elevation & Shadows ── */
  --shadow-xs:       0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm:       0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow:          0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
  --shadow-md:       0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.07);
  --shadow-lg:       0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  --shadow-xl:       0 25px 50px -12px rgba(0, 0, 0, 0.18);

  /* ── Border Radii ── */
  --radius-xs:       4px;
  --radius-sm:       6px;
  --radius:          10px;
  --radius-lg:       14px;
  --radius-xl:       18px;
  --radius-full:     9999px;

  /* ── Transitions ── */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition:      0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 14.5px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: #f8fafc;
  color: var(--gray-800);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ── Page Loader ───────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #10b981, #0ea5e9, #8b5cf6, #2563eb);
  background-size: 300% 100%;
  animation: progress-slide 1.2s linear infinite;
  width: 100%;
  z-index: 10000;
}
@keyframes progress-slide {
  0%   { background-position: 100% 0; }
  100% { background-position: 0% 0; }
}

.loader-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 2.2rem 2.8rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  animation: loader-pop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes loader-pop {
  from { transform: scale(0.85) translateY(12px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.loader-ring {
  position: relative;
  width: 48px;
  height: 48px;
}
.loader-ring div {
  box-sizing: border-box;
  position: absolute;
  inset: 0;
  border: 3.5px solid transparent;
  border-radius: 50%;
  animation: ring-spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.loader-ring div:nth-child(1) { border-top-color: var(--primary); animation-delay: -0.45s; }
.loader-ring div:nth-child(2) { border-top-color: var(--secondary); animation-delay: -0.3s; }
.loader-ring div:nth-child(3) { border-top-color: var(--info); animation-delay: -0.15s; }
.loader-ring div:nth-child(4) { border-top-color: var(--purple); }

@keyframes ring-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.loader-text i {
  color: var(--primary);
  font-size: 1.1rem;
}

@media print {
  #page-loader { display: none !important; }
}

/* ── Top Header ────────────────────────────────────────────── */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: #ffffff;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1000;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

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

/* Sidebar Toggle Buttons */
.btn-nav-toggle {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1rem;
}
.btn-nav-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}
.btn-nav-toggle-mobile {
  display: none;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}
.header-brand:hover {
  opacity: 0.9;
}
.header-brand-logo {
  height: 44px;
  max-width: 220px;
  width: auto;
  object-fit: contain;
  display: block;
}
.brand-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
  color: #fff;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}
.doc-header-logo {
  max-height: 48px;
  max-width: 220px;
  width: auto;
  object-fit: contain;
  display: block;
  margin-bottom: 0.5rem;
}

/* Header Right Actions */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.header-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--gray-600);
  font-weight: 600;
}
.header-pill i {
  color: var(--primary);
  font-size: 0.85rem;
}

/* User profile button / chip */
.header-user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.75rem 0.35rem 0.45rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-800);
}
.header-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.header-user-role {
  font-size: 0.68rem;
  background: var(--gray-200);
  color: var(--gray-700);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}

.btn-header-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.44rem 0.9rem;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--gray-200);
  transition: all var(--transition-fast);
}
.btn-header-logout:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger-border);
  text-decoration: none;
}

/* ── Layout Wrapper ────────────────────────────────────────── */
.layout-wrapper {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  position: relative;
}

/* ── Sidebar Navigation ────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 850;
}

.sidebar {
  width: var(--sidebar-w);
  background: #ffffff;
  border-right: 1px solid var(--gray-200);
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  z-index: 900;
  padding: 1.1rem 0.8rem 2rem;
  transition: width var(--transition), transform var(--transition);
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}
.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

.sidebar-section {
  margin-bottom: 1.2rem;
}

.sidebar-section-label {
  padding: 0.35rem 0.85rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.58rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--gray-600);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
  position: relative;
}
.sidebar-nav li a i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  color: var(--gray-400);
  transition: color var(--transition-fast);
}

.sidebar-nav li a:hover {
  background: var(--gray-100);
  color: var(--gray-900);
  text-decoration: none;
}
.sidebar-nav li a:hover i {
  color: var(--primary);
}

.sidebar-nav li a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}
.sidebar-nav li a.active i {
  color: var(--primary);
}
.sidebar-nav li a.active::after {
  content: '';
  position: absolute;
  right: 0.5rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* Sidebar mini / collapsed mode */
body.sidebar-collapsed .sidebar {
  width: var(--sidebar-w-mini);
  padding: 1.1rem 0.5rem 2rem;
}
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .sidebar-nav li a span,
body.sidebar-collapsed .sidebar-nav li a .nav-badge {
  display: none;
}
body.sidebar-collapsed .sidebar-nav li a {
  justify-content: center;
  padding: 0.7rem;
}
body.sidebar-collapsed .sidebar-nav li a i {
  width: auto;
  font-size: 1.15rem;
}
body.sidebar-collapsed .sidebar-nav li a.active::after {
  display: none;
}
body.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-w-mini);
}
body.sidebar-collapsed .site-footer {
  margin-left: var(--sidebar-w-mini);
}

/* ── Main Content Area ─────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 1.8rem 2rem;
  min-width: 0;
  transition: margin-left var(--transition);
}

/* ── Page Header & Breadcrumbs ─────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.page-header-left {
  display: flex;
  flex-direction: column;
}
.page-header h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.page-header h1 i {
  color: var(--primary);
  font-size: 1.35rem;
}
.breadcrumb {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-400);
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.breadcrumb a {
  color: var(--gray-500);
}
.breadcrumb a:hover {
  color: var(--primary);
}
.breadcrumb-sep {
  color: var(--gray-300);
  font-size: 0.75rem;
}

/* ── Cards & Surfaces ──────────────────────────────────────── */
.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.card:hover {
  box-shadow: var(--shadow);
}
.card-header {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--gray-200);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.card-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.card-header h2 i {
  color: var(--primary);
  font-size: 1.05rem;
}
.card-body {
  padding: 1.4rem;
}
.card-footer {
  padding: 0.9rem 1.4rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

/* ── Dashboard Executive Welcome Hero ──────────────────────── */
.dash-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 2rem 2.2rem;
  margin-bottom: 1.6rem;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.dash-hero::after {
  content: '';
  position: absolute;
  right: -50px;
  bottom: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.dash-hero-content h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.dash-hero-content p {
  font-size: 0.92rem;
  opacity: 0.88;
  line-height: 1.4;
}
.dash-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.btn-hero {
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.86rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.btn-hero-primary {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.btn-hero-primary:hover {
  background: #f8fafc;
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}
.btn-hero-secondary {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
}
.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  text-decoration: none;
}

/* ── Modern Stat Cards ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.6rem;
}
.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  padding: 1.35rem 1.4rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background var(--transition-fast);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-card:hover::before {
  background: var(--primary);
}
.stat-card.stat-green:hover::before  { background: var(--secondary); }
.stat-card.stat-amber:hover::before  { background: var(--warning); }
.stat-card.stat-rose:hover::before   { background: var(--danger); }
.stat-card.stat-purple:hover::before { background: var(--purple); }

.stat-info {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 0.76rem;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
  margin-top: 0.25rem;
  letter-spacing: -0.5px;
}
.stat-sub {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon.green  { background: var(--secondary-light); color: var(--secondary); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red    { background: var(--danger-light); color: var(--danger); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }

/* ── Dashboard Feature Cards ───────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.8rem;
}
.feature-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  position: relative;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
  text-decoration: none;
}
.feature-card .fc-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.1rem;
}
.feature-card .fc-icon.blue   { background: var(--primary-light); color: var(--primary); }
.feature-card .fc-icon.green  { background: var(--secondary-light); color: var(--secondary); }
.feature-card .fc-icon.orange { background: var(--warning-light); color: var(--warning); }
.feature-card .fc-icon.purple { background: var(--purple-light); color: var(--purple); }

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.feature-card h3::after {
  content: '→';
  color: var(--gray-300);
  font-size: 1.1rem;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.feature-card:hover h3::after {
  color: var(--primary);
  transform: translateX(4px);
}
.feature-card p {
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ── Modern Tables & Grids ─────────────────────────────────── */
.table-responsive {
  overflow-x: auto;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}
thead th {
  background: #f8fafc;
  color: var(--gray-600);
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--transition-fast);
}
tbody tr:last-child {
  border-bottom: none;
}
tbody tr:hover {
  background: #f8fafc;
}
tbody td {
  padding: 0.85rem 1.1rem;
  color: var(--gray-700);
  vertical-align: middle;
}
tfoot td {
  padding: 0.9rem 1.1rem;
  font-weight: 700;
  background: #f8fafc;
  border-top: 2px solid var(--gray-200);
  color: var(--gray-800);
}

.table-compact tbody td {
  padding: 0.6rem 0.85rem;
}
.table-compact thead th {
  padding: 0.65rem 0.85rem;
}

/* Empty Table State */
.table-empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--gray-400);
}
.table-empty-state i {
  font-size: 2.4rem;
  margin-bottom: 0.75rem;
  color: var(--gray-300);
  display: block;
}
.table-empty-state h4 {
  font-size: 1rem;
  color: var(--gray-700);
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.table-empty-state p {
  font-size: 0.84rem;
  max-width: 380px;
  margin: 0 auto 1.2rem;
}

/* ── Forms & Form Controls ─────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.15rem;
}
.form-grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.form-grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.form-label .req {
  color: var(--danger);
  font-weight: 700;
}

.form-control {
  width: 100%;
  padding: 0.58rem 0.85rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--gray-800);
  background: #ffffff;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  font-family: var(--font);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}
.form-control::placeholder {
  color: var(--gray-400);
}
.form-control:disabled,
.form-control[readonly] {
  background: var(--gray-50);
  color: var(--gray-600);
  border-color: var(--gray-200);
  cursor: not-allowed;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
}
textarea.form-control {
  resize: vertical;
  min-height: 85px;
  line-height: 1.5;
}
.form-hint {
  font-size: 0.73rem;
  color: var(--gray-400);
  margin-top: 0.15rem;
}

/* ── Buttons & Button Groups ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.56rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.25;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-success {
  background: var(--secondary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}
.btn-success:hover {
  background: var(--secondary-hover);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

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

.btn-warning {
  background: var(--warning);
  color: #ffffff;
}
.btn-warning:hover {
  background: var(--warning-hover);
  color: #ffffff;
}

.btn-info {
  background: var(--info);
  color: #ffffff;
}
.btn-info:hover {
  background: var(--info-hover);
  color: #ffffff;
}

.btn-gray {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-200);
}
.btn-gray:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.btn-outline {
  background: transparent;
  border-color: var(--gray-300);
  color: var(--gray-700);
}
.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.36rem 0.75rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 0.72rem 1.6rem;
  font-size: 0.95rem;
  border-radius: var(--radius);
}

.action-btns {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ── Badges & Status Pills ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.2;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success {
  background: var(--secondary-light);
  color: var(--secondary-text);
  border: 1px solid var(--secondary-border);
}
.badge-danger {
  background: var(--danger-light);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}
.badge-warning {
  background: var(--warning-light);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}
.badge-info {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary-border);
}
.badge-purple {
  background: var(--purple-light);
  color: var(--purple-text);
  border: 1px solid var(--purple-border);
}
.badge-primary {
  background: var(--primary);
  color: #ffffff;
}
.badge-primary::before {
  background: #ffffff;
}

/* ── Alerts & Notifications ────────────────────────────────── */
.alert {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid transparent;
  box-shadow: var(--shadow-xs);
  animation: alert-slide 0.25s ease-out;
}
@keyframes alert-slide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-success {
  background: var(--secondary-light);
  color: var(--secondary-text);
  border-color: var(--secondary-border);
}
.alert-error {
  background: var(--danger-light);
  color: var(--danger-text);
  border-color: var(--danger-border);
}
.alert-info {
  background: var(--info-light);
  color: var(--info-text);
  border-color: var(--info-border);
}
.alert-warning {
  background: var(--warning-light);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

.alert i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Info Box ──────────────────────────────────────────────── */
.info-box {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  padding: 0.8rem 1.1rem;
  font-size: 0.84rem;
  color: var(--primary-dark);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.info-box i {
  font-size: 1.1rem;
  color: var(--primary);
}

/* ── Floating Toast Container ──────────────────────────────── */
#toast-container {
  position: fixed;
  top: calc(var(--header-h) + 16px);
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--gray-800);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.85rem;
  font-weight: 500;
  animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s, transform 0.3s;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.toast-success i { color: var(--secondary); font-size: 1.1rem; }
.toast.toast-error   i { color: var(--danger); font-size: 1.1rem; }
.toast.toast-info    i { color: var(--primary); font-size: 1.1rem; }

/* ── Filter Bars & Search Toolbars ─────────────────────────── */
.filter-bar {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.filter-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 200px;
}
.filter-input-wrap i {
  position: absolute;
  left: 0.85rem;
  color: var(--gray-400);
  pointer-events: none;
  font-size: 0.85rem;
}
.filter-input-wrap .form-control {
  padding-left: 2.3rem;
}

/* ── Code / Monospace / ID Highlights ──────────────────────── */
.font-mono {
  font-family: var(--font-mono) !important;
  font-feature-settings: 'zero' 1;
}

.id-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.22rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.generated-id-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.generated-id-box .id-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: #14532d;
  letter-spacing: 1px;
}

/* ── Quick Add Modals ──────────────────────────────────────── */
.quick-add-group {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}
.quick-add-group select {
  flex: 1;
}
.btn-quick-add {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.58rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--secondary-light);
  color: var(--secondary-text);
  border: 1px solid var(--secondary-border);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.btn-quick-add:hover {
  background: var(--secondary);
  color: #ffffff;
}

.qmodal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(5px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.qmodal-overlay.open {
  display: flex;
}

.qmodal {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  animation: qmodal-scale 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes qmodal-scale {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.qmodal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--gray-200);
  background: #f8fafc;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.qmodal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.qmodal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.35rem;
  color: var(--gray-400);
  line-height: 1;
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.qmodal-close:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}
.qmodal-body {
  padding: 1.4rem;
}
.qmodal-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.qmodal-msg {
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}
.qmodal-msg.success {
  background: var(--secondary-light);
  color: var(--secondary-text);
  border: 1px solid var(--secondary-border);
  display: block;
}
.qmodal-msg.error {
  background: var(--danger-light);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
  display: block;
}

.qmodal-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.addr-fields {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.85rem;
}
.addr-row {
  display: flex;
  gap: 0.65rem;
}
.addr-row .form-group {
  flex: 1;
}
.form-label-sm {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--gray-600);
  display: block;
  margin-bottom: 0.2rem;
}

/* ── Document Previews & Printable Sheets ──────────────────── */
.invoice-box {
  max-width: 880px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.8rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 1.2rem;
  gap: 1.2rem;
}
.inv-company-info h2 {
  font-size: 1.35rem;
  color: var(--primary-dark);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.inv-company-info p {
  font-size: 0.82rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}
.inv-title-area {
  text-align: right;
}
.inv-title-area h1 {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.inv-title-area .inv-no {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-top: 0.3rem;
  font-family: var(--font-mono);
}

.inv-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}
.inv-meta-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.inv-meta-box h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-500);
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.inv-meta-box p {
  font-size: 0.86rem;
  color: var(--gray-800);
  line-height: 1.6;
}

.inv-totals {
  margin-top: 1.2rem;
}
.inv-totals table {
  border: 1px solid var(--gray-200);
}
.inv-totals td {
  border: 1px solid var(--gray-200);
}
.inv-grand-total td {
  background: var(--primary) !important;
  color: #ffffff !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
}

.inv-amount-words {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  padding: 0.75rem 1.1rem;
  font-size: 0.86rem;
  color: var(--primary-dark);
  margin-top: 1rem;
  font-style: italic;
  font-weight: 500;
}

.inv-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--gray-200);
}
.inv-signatory {
  text-align: right;
}
.inv-signatory .sig-line {
  border-top: 1px solid var(--gray-700);
  width: 190px;
  padding-top: 0.45rem;
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-top: 3.5rem;
}
.inv-thank {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ── Corporate Credit Flow Timeline ────────────────────────── */
.flow-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 2rem 0;
}
.flow-step {
  background: #ffffff;
  border: 2px solid var(--primary);
  color: var(--primary-dark);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.1rem;
  text-align: center;
  min-width: 140px;
  max-width: 160px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.flow-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.flow-step .fs-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.6rem;
  font-size: 1.3rem;
}
.flow-step .fs-label {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}
.flow-arrow {
  font-size: 1.5rem;
  color: var(--gray-400);
  padding: 0 0.4rem;
  flex-shrink: 0;
}

.flow-notes {
  background: var(--warning-light);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.6rem;
  margin-top: 1.8rem;
}
.flow-notes h4 {
  color: var(--warning-text);
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.flow-notes ul {
  list-style: none;
}
.flow-notes ul li {
  padding: 0.35rem 0 0.35rem 1.6rem;
  position: relative;
  font-size: 0.86rem;
  color: var(--gray-700);
  border-bottom: 1px dashed rgba(245, 158, 11, 0.25);
}
.flow-notes ul li:last-child {
  border-bottom: none;
}
.flow-notes ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--warning-text);
  font-weight: 800;
}

/* ── Prefix Reference Table ────────────────────────────────── */
.prefix-table thead th {
  background: #f8fafc;
}
.prefix-table .example-id {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
  font-size: 0.92rem;
}

/* ── Site Footer ───────────────────────────────────────────── */
.site-footer {
  background: #ffffff;
  color: var(--gray-500);
  padding: 1rem 2rem;
  margin-left: var(--sidebar-w);
  border-top: 1px solid var(--gray-200);
  transition: margin-left var(--transition);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.footer-inner strong {
  color: var(--gray-800);
}

/* ── Utility Classes ───────────────────────────────────────── */
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.w-full { width: 100%; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.fw-bold     { font-weight: 700; }
.text-danger { color: var(--danger) !important; }
.text-success{ color: var(--secondary) !important; }
.text-primary{ color: var(--primary) !important; }
.text-muted  { color: var(--gray-400) !important; }

/* ── Consignment Slip & Document Specific Classes ──────────── */
.slip-table-wrap {
  margin: 1rem 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}
.slip-charges-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.9rem;
}
.slip-charges-table {
  width: 280px;
  font-size: 0.85rem;
  border: 1px solid var(--gray-200);
}
.slip-charges-table td {
  padding: 0.4rem 0.8rem;
}
.slip-grand-row {
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
}
.slip-footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  margin-top: 1.2rem;
  font-size: 0.8rem;
  color: var(--gray-600);
  align-items: flex-end;
}
.slip-terms ol {
  margin: 0.3rem 0 0 1.1rem;
  line-height: 1.5;
  font-size: 0.76rem;
}
.slip-signatures {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.8rem;
}
.slip-signatures .sig-block {
  text-align: center;
  width: 180px;
}
.slip-signatures .sig-line {
  border-top: 1px solid var(--gray-700);
  padding-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.slip-signatures .sig-line-auth {
  color: var(--primary);
}

/* ── Screen Responsive Rules ──────────────────────────────── */
@media screen and (max-width: 992px) {
  :root {
    --sidebar-w: 240px;
  }
}

@media screen and (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
  }

  .btn-nav-toggle-mobile {
    display: inline-flex;
  }
  .btn-nav-toggle-desktop {
    display: none;
  }

  .sidebar {
    transform: translateX(-280px);
    width: 280px !important;
    box-shadow: var(--shadow-xl);
    top: 0;
    z-index: 1200;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop.open {
    display: block;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 1.2rem 1rem;
  }
  .site-footer {
    margin-left: 0 !important;
    padding: 1rem;
  }

  .top-header {
    padding: 0 1rem;
  }
  .header-brand-logo {
    height: 36px;
    max-width: 150px;
  }
  .header-pill {
    display: none;
  }

  .dash-hero {
    padding: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .inv-meta {
    grid-template-columns: 1fr;
  }
  .invoice-header {
    flex-direction: column;
    gap: 1rem;
  }
  .inv-title-area {
    text-align: left;
  }
}

/* ── Single Page Print Media Query ────────────────────────── */
@page {
  size: A4 portrait;
  margin: 0mm;
}

@media print {
  .top-header,
  .sidebar,
  .site-footer,
  .no-print,
  #sidebar-toggle,
  .btn,
  #page-loader,
  #toast-container {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 5mm 7mm !important;
    margin: 0 !important;
    font-size: 9.5px !important;
    line-height: 1.25 !important;
  }

  .layout-wrapper {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .invoice-box {
    border: 1.2px solid #0f172a !important;
    box-shadow: none !important;
    padding: 10px 14px !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .invoice-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 0.35rem !important;
    padding-bottom: 0.3rem !important;
    border-bottom: 1.5px solid var(--primary) !important;
    gap: 0.5rem !important;
  }

  .inv-company-info {
    text-align: left !important;
  }
  .doc-header-logo {
    max-height: 30px !important;
    max-width: 140px !important;
    margin-bottom: 2px !important;
    display: block !important;
  }
  .inv-company-info p {
    font-size: 0.7rem !important;
    margin-top: 0 !important;
    line-height: 1.2 !important;
  }

  .inv-title-area {
    text-align: right !important;
  }
  .inv-title-area h1 {
    font-size: 1.1rem !important;
    letter-spacing: 0.4px !important;
    margin: 0 !important;
    line-height: 1.1 !important;
  }
  .inv-title-area .inv-no {
    font-size: 0.78rem !important;
    margin-top: 0.1rem !important;
  }
  .inv-title-area div {
    font-size: 0.7rem !important;
    margin-top: 0.1rem !important;
    line-height: 1.2 !important;
  }

  /* Force side-by-side 2 column grid for Consignor / Consignee in print */
  .inv-meta {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.45rem !important;
    margin-bottom: 0.35rem !important;
  }
  .inv-meta-box {
    padding: 0.3rem 0.5rem !important;
    border-radius: 4px !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
  }
  .inv-meta-box h4 {
    font-size: 0.65rem !important;
    margin-bottom: 0.15rem !important;
    letter-spacing: 0.4px !important;
  }
  .inv-meta-box p {
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
  }

  .slip-table-wrap,
  .table-responsive {
    margin: 0.35rem 0 !important;
    border: 1px solid #cbd5e1 !important;
  }
  table {
    font-size: 0.72rem !important;
    margin-bottom: 0 !important;
  }
  table th {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.65rem !important;
    background: #1e3a8a !important;
    color: #ffffff !important;
  }
  table td {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.7rem !important;
  }

  .slip-charges-wrap {
    margin-bottom: 0.3rem !important;
  }
  .slip-charges-table {
    width: 220px !important;
    font-size: 0.7rem !important;
  }
  .slip-charges-table td {
    padding: 0.18rem 0.4rem !important;
  }

  .inv-amount-words {
    padding: 0.2rem 0.45rem !important;
    font-size: 0.7rem !important;
    margin-bottom: 0.3rem !important;
    line-height: 1.2 !important;
  }

  .slip-footer-grid {
    display: grid !important;
    grid-template-columns: 1.25fr 0.75fr !important;
    gap: 0.6rem !important;
    margin-top: 0.35rem !important;
    font-size: 0.65rem !important;
    align-items: flex-end !important;
  }
  .slip-terms ol {
    margin: 0.1rem 0 0 0.8rem !important;
    line-height: 1.2 !important;
    font-size: 0.62rem !important;
  }
  .slip-signatures {
    gap: 0.8rem !important;
  }
  .slip-signatures .sig-block {
    width: 140px !important;
  }
  .slip-signatures .sig-line {
    padding-top: 0.15rem !important;
    font-size: 0.65rem !important;
    border-top: 1px solid #334155 !important;
  }

  .inv-footer {
    margin-top: 0.4rem !important;
    padding-top: 0.3rem !important;
  }
}
