/* ============================================
   G2 Admin — Clean Professional Light Theme
   Bright, vibrant logistics back-office
   ============================================ */

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

:root {
  /* ---- Backgrounds ---- */
  --bg-primary: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F1F5F9;
  --bg-input: #FFFFFF;
  --bg-hover: #F1F5F9;
  --bg-overlay: rgba(15, 23, 42, 0.5);

  /* ---- Sidebar (dark slate) ---- */
  --sidebar-bg: #1E293B;
  --sidebar-hover: #334155;
  --sidebar-active-bg: rgba(10, 101, 204, 0.25);
  --sidebar-text: #94A3B8;
  --sidebar-text-active: #FFFFFF;
  --sidebar-border: #334155;

  /* ---- Borders ---- */
  --border-default: #E2E8F0;
  --border-subtle: #F1F5F9;
  --border-active: #0A65CC;
  --border-glow: rgba(10, 101, 204, 0.15);

  /* ---- Text ---- */
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-dim: #94A3B8;
  --text-inverse: #FFFFFF;

  /* ---- Brand ---- */
  --brand-blue: #0A65CC;
  --brand-blue-hover: #0B78F0;
  --brand-blue-muted: #EFF6FF;

  /* ---- Status ---- */
  --status-pending: #D97706;
  --status-pending-bg: #FFFBEB;
  --status-pending-border: #FDE68A;

  --status-active: #16A34A;
  --status-active-bg: #F0FDF4;
  --status-active-border: #BBF7D0;

  --status-completed: #0891B2;
  --status-completed-bg: #ECFEFF;
  --status-completed-border: #A5F3FC;

  --status-cancelled: #DC2626;
  --status-cancelled-bg: #FEF2F2;
  --status-cancelled-border: #FECACA;

  /* ---- Movement Type Colours ---- */
  --move-dealer-transfer: #2563EB;
  --move-dealer-transfer-bg: #EFF6FF;
  --move-retail-delivery: #16A34A;
  --move-retail-delivery-bg: #F0FDF4;
  --move-vehicle-transport: #6B7280;
  --move-vehicle-transport-bg: #F3F4F6;
  --move-auction-collection: #D97706;
  --move-auction-collection-bg: #FFFBEB;
  --move-auction-delivery: #EA580C;
  --move-auction-delivery-bg: #FFF7ED;
  --move-other: #DC2626;
  --move-other-bg: #FEF2F2;

  /* ---- Progressive Pricing Tiers ---- */
  --tier-1: #9CA3AF;
  --tier-2: #D97706;
  --tier-3: #2563EB;
  --tier-4: #059669;

  /* ---- Typography ---- */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;

  /* ---- Spacing ---- */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-2xl: 2rem;
  --space-3xl: 3rem;

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

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow-blue: 0 0 0 3px rgba(10, 101, 204, 0.12);
  --shadow-glow-cyan: 0 0 0 3px rgba(8, 145, 178, 0.12);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);

  /* ---- Transitions ---- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* ---- Layout ---- */
  --nav-width: 240px;
  --nav-collapsed-width: 64px;
  --header-height: 0px;
  --content-max-width: 1440px;
}

/* ---- Base ---- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Layout Shell ---- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: var(--nav-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-base), transform var(--transition-base);
}

.app-main {
  flex: 1;
  margin-left: var(--nav-width);
  min-height: 100vh;
  width: calc(100% - var(--nav-width));
  overflow-x: hidden;
  transition: margin-left var(--transition-base);
}

.app-content {
  padding: var(--space-2xl);
  width: 100%;
}

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
  gap: var(--space-lg);
}

.page-header h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.page-header .subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* ---- Utility Classes ---- */
.font-mono {
  font-family: var(--font-mono);
}

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-dim { color: var(--text-dim); }
.text-brand { color: var(--brand-blue); }
.text-pending { color: var(--status-pending); }
.text-active { color: var(--status-active); }
.text-completed { color: var(--status-completed); }
.text-cancelled { color: var(--status-cancelled); }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .app-sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
    width: 100%;
    padding-top: 56px;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 199;
  }

  .sidebar-overlay.active {
    display: block;
  }
}

@media (max-width: 640px) {
  .app-content {
    padding: var(--space-md);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .app-content {
    padding: var(--space-sm);
  }
}
