/* ==========================================================================
   CV. MECHA SOLUTION LESTARI - ENTERPRISE COMMAND DESIGN SYSTEM
   Field Operations & Asset Telemetry Management Platform • Makassar Hub
   100% Standalone Production CSS (Zero External CDN Dependency)
   ========================================================================== */

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

/* --- THEME VARIABLES --- */
:root, .light-theme {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-subtle: #f1f5f9;
  --bg-subtle-hover: #e2e8f0;
  --bg-input: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-subtle: #f1f5f9;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Brand Accents */
  --brand-primary: #2563eb;
  --brand-primary-hover: #1d4ed8;
  --brand-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --brand-subtle: #eff6ff;
  --brand-border: #bfdbfe;
  --brand-text: #1d4ed8;

  --brand-red: #ef4444;
  --brand-red-subtle: #fef2f2;
  --brand-red-border: #fecaca;
  --brand-red-text: #b91c1c;

  /* Status Colors */
  --status-pending-bg: #fffbeb;
  --status-pending-border: #fde68a;
  --status-pending-text: #b45309;
  --status-pending-dot: #f59e0b;

  --status-progress-bg: #eff6ff;
  --status-progress-border: #bfdbfe;
  --status-progress-text: #1d4ed8;
  --status-progress-dot: #3b82f6;

  --status-completed-bg: #ecfdf5;
  --status-completed-border: #a7f3d0;
  --status-completed-text: #047857;
  --status-completed-dot: #10b981;

  --status-critical-bg: #fef2f2;
  --status-critical-border: #fecaca;
  --status-critical-text: #b91c1c;
  --status-critical-dot: #ef4444;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.1), 0 4px 8px -2px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 32px -8px rgba(15, 23, 42, 0.12);

  --ring-color: rgba(37, 99, 235, 0.2);
}

.dark-theme {
  --bg-page: #0b0f19;
  --bg-surface: #111827;
  --bg-card: #151e32;
  --bg-card-hover: #1b2640;
  --bg-subtle: #192338;
  --bg-subtle-hover: #212e4a;
  --bg-input: #111827;
  --bg-glass: rgba(17, 24, 39, 0.85);

  --border-color: #1f2d45;
  --border-strong: #2c3e5e;
  --border-subtle: #192338;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --brand-subtle: rgba(59, 130, 246, 0.15);
  --brand-border: rgba(59, 130, 246, 0.35);
  --brand-text: #93c5fd;

  --brand-red: #f43f5e;
  --brand-red-subtle: rgba(244, 63, 94, 0.15);
  --brand-red-border: rgba(244, 63, 94, 0.35);
  --brand-red-text: #fca5a5;

  --status-pending-bg: rgba(245, 158, 11, 0.12);
  --status-pending-border: rgba(245, 158, 11, 0.3);
  --status-pending-text: #fde68a;
  --status-pending-dot: #f59e0b;

  --status-progress-bg: rgba(59, 130, 246, 0.15);
  --status-progress-border: rgba(59, 130, 246, 0.35);
  --status-progress-text: #bfdbfe;
  --status-progress-dot: #60a5fa;

  --status-completed-bg: rgba(16, 185, 129, 0.15);
  --status-completed-border: rgba(16, 185, 129, 0.35);
  --status-completed-text: #a7f3d0;
  --status-completed-dot: #34d399;

  --status-critical-bg: rgba(239, 68, 68, 0.15);
  --status-critical-border: rgba(239, 68, 68, 0.35);
  --status-critical-text: #fecaca;
  --status-critical-dot: #f87171;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.65);
  --shadow-xl: 0 20px 38px rgba(0, 0, 0, 0.75);

  --ring-color: rgba(59, 130, 246, 0.3);
}

/* --- BASE & RESETS --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem; /* 14px base font */
  line-height: 1.5;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Custom Typography */
.font-mono-tech {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.02em;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- STANDALONE LAYOUT UTILITIES (Zero CDN Dependency) --- */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none !important; }

.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }

.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }

.min-w-0 { min-width: 0; }
.min-h-0 { min-height: 0; }
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }

/* Grid columns */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Gaps */
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-3\.5 { gap: 0.875rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

/* Spacing Helpers */
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.375rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-2\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.625rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-3\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.875rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-y-5 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.25rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }

/* Padding & Margins */
.p-0\.5 { padding: 0.125rem; }
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }

.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }

.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pt-5 { padding-top: 1.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-1\.5 { margin-top: 0.375rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-2\.5 { margin-top: 0.625rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* Dimensions & Bounds */
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }

.w-4 { width: 1rem; height: 1rem; }
.w-5 { width: 1.25rem; height: 1.25rem; }
.w-6 { width: 1.5rem; height: 1.5rem; }
.w-7 { width: 1.75rem; height: 1.75rem; }
.w-8 { width: 2rem; height: 2rem; }
.w-9 { width: 2.25rem; height: 2.25rem; }
.w-10 { width: 2.5rem; height: 2.5rem; }
.w-12 { width: 3rem; height: 3rem; }
.w-14 { width: 3.5rem; height: 3.5rem; }
.w-16 { width: 4rem; height: 4rem; }
.w-20 { width: 5rem; height: 5rem; }

.h-1\.5 { height: 0.375rem; }
.h-2 { height: 0.5rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-7 { height: 1.75rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-32 { height: 8rem; }
.h-40 { height: 10rem; }
.h-48 { height: 12rem; }

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.inset-0 { inset: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-50 { z-index: 50; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Typography */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-\[9px\] { font-size: 0.5625rem; }
.text-\[10px\] { font-size: 0.625rem; }
.text-\[11px\] { font-size: 0.6875rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }

.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.italic { font-style: italic; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.leading-snug { line-height: 1.375; }
.leading-relaxed { line-height: 1.625; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Borders & Rounded */
.border { border: 1px solid var(--border-color); }
.border-b { border-bottom: 1px solid var(--border-color); }
.border-t { border-top: 1px solid var(--border-color); }
.border-r { border-right: 1px solid var(--border-color); }
.border-l { border-left: 1px solid var(--border-color); }
.border-2 { border-width: 2px; }
.border-dashed { border-style: dashed; }

.divide-y > :not([hidden]) ~ :not([hidden]) {
  border-top: 1px solid var(--border-color);
}

.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

/* Colors */
.text-white { color: #ffffff !important; }
.text-black { color: #000000 !important; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-emerald-600 { color: #059669; }
.text-amber-600 { color: #d97706; }
.text-rose-500 { color: #f43f5e; }
.text-rose-600 { color: #e11d48; }

.bg-white { background-color: #ffffff; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-600 { background-color: #059669; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-rose-500 { background-color: #f43f5e; }
.bg-rose-600 { background-color: #e11d48; }

/* Backdrop Blur */
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(8px); }

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (min-width: 640px) {
  .sm\:flex { display: flex; }
  .sm\:inline { display: inline; }
  .sm\:block { display: block; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:w-60 { width: 15rem; }
  .sm\:w-64 { width: 16rem; }
  .sm\:w-auto { width: auto; }
  .sm\:p-5 { padding: 1.25rem; }
  .sm\:p-6 { padding: 1.5rem; }
  .sm\:p-10 { padding: 2.5rem; }
  .sm\:text-sm { font-size: 0.875rem; }
  .sm\:text-2xl { font-size: 1.5rem; }
}

@media (min-width: 768px) {
  .md\:flex { display: flex !important; }
  .md\:hidden { display: none !important; }
  .md\:flex-row { flex-direction: row; }
  .md\:w-72 { width: 18rem; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:items-center { align-items: center; }
  .md\:inline { display: inline; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .lg\:col-span-5 { grid-column: span 5 / span 5; }
  .lg\:col-span-7 { grid-column: span 7 / span 7; }
  .lg\:p-8 { padding: 2rem; }
  .lg\:border-b-0 { border-bottom-width: 0; }
  .lg\:border-r { border-right: 1px solid var(--border-color); }
  .lg\:pb-0 { padding-bottom: 0; }
  .lg\:pr-5 { padding-right: 1.25rem; }
  .lg\:pr-6 { padding-right: 1.5rem; }
}

/* --- ENTERPRISE CARDS & PANELS --- */
.pro-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.875rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.pro-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  border-top-left-radius: 0.875rem;
  border-top-right-radius: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- STATUS PILLS & DOTS --- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

.status-pill-pending {
  background-color: var(--status-pending-bg);
  color: var(--status-pending-text);
  border: 1px solid var(--status-pending-border);
}

.status-pill-progress {
  background-color: var(--status-progress-bg);
  color: var(--status-progress-text);
  border: 1px solid var(--status-progress-border);
}

.status-pill-completed {
  background-color: var(--status-completed-bg);
  color: var(--status-completed-text);
  border: 1px solid var(--status-completed-border);
}

.status-pill-critical {
  background-color: var(--status-critical-bg);
  color: var(--status-critical-text);
  border: 1px solid var(--status-critical-border);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot-pending { background-color: var(--status-pending-dot); }
.status-dot-progress { background-color: var(--status-progress-dot); }
.status-dot-completed { background-color: var(--status-completed-dot); }
.status-dot-critical { background-color: var(--status-critical-dot); }

/* --- ICON BADGES & BOXES --- */
.icon-box, .icon-badge {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.icon-box-blue, .icon-badge-blue {
  background-color: var(--brand-subtle) !important;
  border: 1px solid var(--brand-border) !important;
  color: var(--brand-text) !important;
}

.icon-box-emerald, .icon-badge-emerald {
  background-color: var(--status-completed-bg) !important;
  border: 1px solid var(--status-completed-border) !important;
  color: var(--status-completed-text) !important;
}

.icon-box-amber, .icon-badge-amber {
  background-color: var(--status-pending-bg) !important;
  border: 1px solid var(--status-pending-border) !important;
  color: var(--status-pending-text) !important;
}

.icon-box-rose, .icon-badge-rose {
  background-color: var(--status-critical-bg) !important;
  border: 1px solid var(--status-critical-border) !important;
  color: var(--status-critical-text) !important;
}

.icon-box-neutral {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* --- BUTTONS --- */
.btn-primary {
  background: var(--brand-gradient);
  color: #ffffff !important;
  font-weight: 600;
  border-radius: 0.625rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-secondary:hover {
  background-color: var(--bg-subtle-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* --- LOGO BADGE --- */
.logo-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.65rem;
  background-color: #ffffff;
  border-radius: 0.625rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* --- NAV ITEMS --- */
.nav-group-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.65rem 0.75rem 0.25rem 0.75rem;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.625rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  text-align: left;
}

.nav-link:hover {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--brand-gradient);
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-link.active .icon-box,
.nav-link.active .icon-badge {
  background-color: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
}

/* --- METRIC KPI STAT CARDS --- */
.kpi-card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.875rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.2s ease;
}
.kpi-card.kpi-blue::after { background: var(--brand-gradient); }
.kpi-card.kpi-amber::after { background: linear-gradient(90deg, #f59e0b, #d97706); }
.kpi-card.kpi-emerald::after { background: linear-gradient(90deg, #10b981, #059669); }
.kpi-card.kpi-purple::after { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }

/* --- INPUTS & CONTROLS --- */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--ring-color);
}

/* --- AUTH PATTERN --- */
.login-hero-pattern {
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(239, 68, 68, 0.08) 0%, transparent 40%),
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
}

.dark-theme .login-hero-pattern {
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(239, 68, 68, 0.15) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
}

/* --- PRINT RULES --- */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }
  .no-print, header, nav, aside, #toast-container, .modal-backdrop, #dossier-modal, #dispatch-modal, #inventory-modal, #spk-modal {
    display: none !important;
  }
  .print-area {
    display: block !important;
    position: static !important;
    width: 100% !important;
  }
}

/* ==============================================================================
   STANDALONE UTILITY ENGINE (Ensures 100% Fidelity Offline or if Tailwind CDN is Blocked)
   ============================================================================== */
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.grid { display: grid !important; }
/* .hidden MUST ALWAYS BE AFTER ALL DISPLAY RULES TO OVERRIDE .flex / .grid */
[hidden], .hidden, [aria-hidden="true"].hidden { display: none !important; }

/* Flexbox alignment & direction */
.flex-col { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-start { justify-content: flex-start !important; }
.flex-1 { flex: 1 1 0% !important; }
.shrink-0 { flex-shrink: 0 !important; }
.grow { flex-grow: 1 !important; }

/* Gaps */
.gap-1 { gap: 0.25rem !important; }
.gap-1\.5 { gap: 0.375rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-2\.5 { gap: 0.625rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-3\.5 { gap: 0.875rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-5 { gap: 1.25rem !important; }
.gap-6 { gap: 1.5rem !important; }
.gap-8 { gap: 2rem !important; }

/* Grids */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; }

.col-span-1 { grid-column: span 1 / span 1 !important; }
.col-span-2 { grid-column: span 2 / span 2 !important; }
.col-span-3 { grid-column: span 3 / span 3 !important; }
.col-span-4 { grid-column: span 4 / span 4 !important; }
.col-span-5 { grid-column: span 5 / span 5 !important; }
.col-span-6 { grid-column: span 6 / span 6 !important; }
.col-span-7 { grid-column: span 7 / span 7 !important; }
.col-span-8 { grid-column: span 8 / span 8 !important; }
.col-span-12 { grid-column: span 12 / span 12 !important; }

/* Sizing & Dimensions */
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.min-h-screen { min-height: 100vh !important; }
.w-fit { width: fit-content !important; }
.min-w-0 { min-width: 0px !important; }
.min-h-0 { min-height: 0px !important; }

.max-w-xs { max-width: 20rem !important; }
.max-w-sm { max-width: 24rem !important; }
.max-w-md { max-width: 28rem !important; }
.max-w-xl { max-width: 36rem !important; }
.max-w-2xl { max-width: 42rem !important; }
.max-w-3xl { max-width: 48rem !important; }
.max-w-4xl { max-width: 56rem !important; }
.max-w-5xl { max-width: 64rem !important; }

.w-4 { width: 1rem !important; }
.h-4 { height: 1rem !important; }
.w-3\.5 { width: 0.875rem !important; }
.h-3\.5 { height: 0.875rem !important; }
.w-5 { width: 1.25rem !important; }
.h-5 { height: 1.25rem !important; }
.w-6 { width: 1.5rem !important; }
.h-6 { height: 1.5rem !important; }
.w-7 { width: 1.75rem !important; }
.h-7 { height: 1.75rem !important; }
.w-8 { width: 2rem !important; }
.h-8 { height: 2rem !important; }
.w-9 { width: 2.25rem !important; }
.h-9 { height: 2.25rem !important; }
.w-10 { width: 2.5rem !important; }
.h-10 { height: 2.5rem !important; }
.w-12 { width: 3rem !important; }
.h-12 { height: 3rem !important; }
.w-16 { width: 4rem !important; }
.h-16 { height: 4rem !important; }
.w-2 { width: 0.5rem !important; }
.h-2 { height: 0.5rem !important; }
.w-2\.5 { width: 0.625rem !important; }
.h-2\.5 { height: 0.625rem !important; }

.object-cover { object-fit: cover !important; }
.object-contain { object-fit: contain !important; }

/* Positioning & Layers */
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed { position: fixed !important; }
.inset-0 { inset: 0 !important; }
.inset-y-0 { top: 0 !important; bottom: 0 !important; }
.left-0 { left: 0 !important; }
.right-0 { right: 0 !important; }
.top-0 { top: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.bottom-5 { bottom: 1.25rem !important; }
.right-5 { right: 1.25rem !important; }
.-top-16 { top: -4rem !important; }
.-right-16 { right: -4rem !important; }
.-bottom-16 { bottom: -4rem !important; }
.-left-16 { left: -4rem !important; }
.-bottom-0\.5 { bottom: -0.125rem !important; }
.-right-0\.5 { right: -0.125rem !important; }

.z-10 { z-index: 10 !important; }
.z-20 { z-index: 20 !important; }
.z-30 { z-index: 30 !important; }
.z-40 { z-index: 40 !important; }
.z-50 { z-index: 50 !important; }

.overflow-hidden { overflow: hidden !important; }
.overflow-y-auto { overflow-y: auto !important; }
.overflow-x-auto { overflow-x: auto !important; }

/* Padding & Margins */
.p-2 { padding: 0.5rem !important; }
.p-2\.5 { padding: 0.625rem !important; }
.p-3 { padding: 0.75rem !important; }
.p-3\.5 { padding: 0.875rem !important; }
.p-4 { padding: 1rem !important; }
.p-5 { padding: 1.25rem !important; }
.p-6 { padding: 1.5rem !important; }
.p-8 { padding: 2rem !important; }

.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-2\.5 { padding-left: 0.625rem !important; padding-right: 0.625rem !important; }
.px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.px-3\.5 { padding-left: 0.875rem !important; padding-right: 0.875rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-5 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
.px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }

.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-1\.5 { padding-top: 0.375rem !important; padding-bottom: 0.375rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-2\.5 { padding-top: 0.625rem !important; padding-bottom: 0.625rem !important; }
.py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }

.pt-2 { padding-top: 0.5rem !important; }
.pt-4 { padding-top: 1rem !important; }
.pt-6 { padding-top: 1.5rem !important; }
.pt-8 { padding-top: 2rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-3 { padding-bottom: 0.75rem !important; }
.pb-4 { padding-bottom: 1rem !important; }
.pb-5 { padding-bottom: 1.25rem !important; }
.pb-6 { padding-bottom: 1.5rem !important; }

.m-0 { margin: 0 !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-5 { margin-top: 1.25rem !important; }
.mt-6 { margin-top: 1.5rem !important; }
.mt-8 { margin-top: 2rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-2\.5 { margin-bottom: 0.625rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.25rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }

.space-y-1 > * + * { margin-top: 0.25rem !important; }
.space-y-1\.5 > * + * { margin-top: 0.375rem !important; }
.space-y-2 > * + * { margin-top: 0.5rem !important; }
.space-y-2\.5 > * + * { margin-top: 0.625rem !important; }
.space-y-3 > * + * { margin-top: 0.75rem !important; }
.space-y-4 > * + * { margin-top: 1rem !important; }
.space-y-5 > * + * { margin-top: 1.25rem !important; }
.space-y-6 > * + * { margin-top: 1.5rem !important; }
.space-x-1 > * + * { margin-left: 0.25rem !important; }
.space-x-2 > * + * { margin-left: 0.5rem !important; }
.space-x-3 > * + * { margin-left: 0.75rem !important; }
.space-x-4 > * + * { margin-left: 1rem !important; }

/* Borders & Rounding */
.border { border: 1px solid var(--border-color) !important; }
.border-t { border-top: 1px solid var(--border-color) !important; }
.border-b { border-bottom: 1px solid var(--border-color) !important; }
.border-r { border-right: 1px solid var(--border-color) !important; }
.border-l { border-left: 1px solid var(--border-color) !important; }
.border-dashed { border-style: dashed !important; }

.rounded { border-radius: 0.25rem !important; }
.rounded-md { border-radius: 0.375rem !important; }
.rounded-lg { border-radius: 0.5rem !important; }
.rounded-xl { border-radius: 0.75rem !important; }
.rounded-2xl { border-radius: 1rem !important; }
.rounded-3xl { border-radius: 1.5rem !important; }
.rounded-full { border-radius: 9999px !important; }

/* Backdrop Blur & Opacity */
.backdrop-blur-sm { backdrop-filter: blur(4px) !important; -webkit-backdrop-filter: blur(4px) !important; }
.backdrop-blur-md { backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important; }
.backdrop-blur-lg { backdrop-filter: blur(16px) !important; -webkit-backdrop-filter: blur(16px) !important; }
.bg-slate-950\/80 { background-color: rgba(2, 6, 23, 0.8) !important; }
.bg-slate-950\/90 { background-color: rgba(2, 6, 23, 0.9) !important; }
.bg-black\/50 { background-color: rgba(0, 0, 0, 0.5) !important; }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1) !important; }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2) !important; }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1) !important; }

/* Typography */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.uppercase { text-transform: uppercase !important; }
.capitalize { text-transform: capitalize !important; }
.lowercase { text-transform: lowercase !important; }
.tracking-tight { letter-spacing: -0.025em !important; }
.tracking-wider { letter-spacing: 0.05em !important; }
.tracking-widest { letter-spacing: 0.1em !important; }
.leading-none { line-height: 1 !important; }
.leading-tight { line-height: 1.25 !important; }
.leading-relaxed { line-height: 1.625 !important; }
.truncate { overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }

.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.font-extrabold { font-weight: 800 !important; }

.text-\[10px\] { font-size: 10px !important; line-height: 14px !important; }
.text-\[11px\] { font-size: 11px !important; line-height: 15px !important; }
.text-xs { font-size: 0.75rem !important; line-height: 1rem !important; }
.text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
.text-base { font-size: 1rem !important; line-height: 1.5rem !important; }
.text-lg { font-size: 1.125rem !important; line-height: 1.75rem !important; }
.text-xl { font-size: 1.25rem !important; line-height: 1.75rem !important; }
.text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; }
.text-3xl { font-size: 1.875rem !important; line-height: 2.25rem !important; }

/* Color overrides */
.text-white { color: #ffffff !important; }
.text-blue-200 { color: #bfdbfe !important; }
.text-blue-400 { color: #60a5fa !important; }
.text-blue-600 { color: #2563eb !important; }
.text-blue-700 { color: #1d4ed8 !important; }
.text-emerald-400 { color: #34d399 !important; }
.text-emerald-600 { color: #059669 !important; }
.text-emerald-700 { color: #047857 !important; }
.text-amber-500 { color: #f59e0b !important; }
.text-amber-600 { color: #d97706 !important; }
.text-rose-600 { color: #e11d48 !important; }
.text-rose-700 { color: #be123c !important; }
.text-slate-300 { color: #cbd5e1 !important; }
.text-slate-400 { color: #94a3b8 !important; }
.text-slate-500 { color: #64748b !important; }
.text-gray-500 { color: #6b7280 !important; }
.text-gray-700 { color: #374151 !important; }
.text-gray-800 { color: #1f2937 !important; }

.bg-white { background-color: #ffffff !important; }
.bg-blue-50 { background-color: #eff6ff !important; }
.bg-blue-600 { background-color: #2563eb !important; }
.bg-emerald-500 { background-color: #10b981 !important; }
.bg-emerald-600 { background-color: #059669 !important; }
.bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.2) !important; }
.bg-blue-500\/10 { background-color: rgba(59, 130, 246, 0.1) !important; }
.bg-blue-500\/20 { background-color: rgba(59, 130, 246, 0.2) !important; }
.bg-red-500\/10 { background-color: rgba(239, 68, 68, 0.1) !important; }
.bg-rose-50 { background-color: #fff1f2 !important; }
.bg-rose-600 { background-color: #e11d48 !important; }
.bg-gray-100 { background-color: #f3f4f6 !important; }
.bg-gray-50 { background-color: #f9fafb !important; }

/* Responsive Media Queries */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .sm\:flex-row { flex-direction: row !important; }
  .sm\:p-5 { padding: 1.25rem !important; }
  .sm\:p-6 { padding: 1.5rem !important; }
  .sm\:p-8 { padding: 2rem !important; }
  .sm\:p-10 { padding: 2.5rem !important; }
  .sm\:inline { display: inline !important; }
}

@media (min-width: 768px) {
  .md\:flex-row { flex-direction: row !important; }
  .md\:w-72 { width: 18rem !important; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .md\:col-span-2 { grid-column: span 2 / span 2 !important; }
  .md\:col-span-3 { grid-column: span 3 / span 3 !important; }
  .md\:p-8 { padding: 2rem !important; }
  .md\:hidden { display: none !important; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; }
  .lg\:col-span-5 { grid-column: span 5 / span 5 !important; }
  .lg\:col-span-7 { grid-column: span 7 / span 7 !important; }
  .lg\:col-span-8 { grid-column: span 8 / span 8 !important; }
  .lg\:col-span-4 { grid-column: span 4 / span 4 !important; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

/* ABSOLUTE FINAL OVERRIDE: Ensure hidden elements remain hidden regardless of other classes */
[hidden], .hidden, [aria-hidden="true"].hidden {
  display: none !important;
}


