/* ==========================================================================
   MENARD TRADING CC — ENTERPRISE DESIGN SYSTEM
   Theme: Executive Logistics (Slate #090D16, Gold #B47828, White/Neutral surfaces)
   ========================================================================== */

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

/* Prevent Alpine.js un-hydrated element flashing (FOUC) */
[x-cloak] {
  display: none !important;
}

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Brand Palette */
  --brand-primary: #b47828;
  --brand-primary-hover: #9c641d;
  --brand-primary-light: #dca048;
  --brand-primary-subtle: #fdf8f0;
  --brand-navy-950: #090d16;
  --brand-navy-900: #0f172a;
  --brand-navy-800: #1e293b;
  --brand-navy-700: #334155;

  /* Surface & Border Neutrals */
  --surface-canvas: #f8fafc;
  --surface-card: #ffffff;
  --surface-muted: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-focus: #b47828;

  /* Typography Colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
}

html {
  font-size: 75% !important;
  font-family: var(--font-sans);
  background-color: var(--surface-canvas);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Utilities */
.no-scrollbar::-webkit-scrollbar,
.no-scrollbar *::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}
.no-scrollbar {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

/* ==========================================================================
   REUSABLE DESIGN SYSTEM UTILITIES & COMPONENTS
   ========================================================================== */

/* Global Layout Container (Spacious, modern 1440px max-width) */
.layout-container {
  width: 100%;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .layout-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .layout-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
@media (min-width: 1280px) {
  .layout-container {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

/* Brand & Logo Typography */
.brand-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #ffffff;
  line-height: 1.2;
}
.brand-tagline {
  font-size: 0.5625rem; /* ~9px */
  font-weight: 500;
  letter-spacing: 0.12em;
  color: #dca048;
  opacity: 0.9;
  line-height: 1;
}

/* Page Headers & Typography */
.page-header-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
}
.page-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin: 0;
}
.page-description {
  font-size: 0.75rem;
  font-weight: 400;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Section & Card Headings */
.section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.section-subtitle {
  font-size: 0.75rem;
  font-weight: 400;
  color: #64748b;
}

/* Primary Metric Cards */
.kpi-metric-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.kpi-metric-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
}

/* Standardized Content Cards */
.surface-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
}

/* Standardized Table Styles — Clean Enterprise Zebra Striped */
.table-container {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
}

table:not(.items-table):not(.doc-items-table) {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
}

.table-header-cell,
table:not(.items-table):not(.doc-items-table) thead th,
thead.bg-slate-50 th,
thead.bg-slate-100 th {
  padding: 0.75rem 1rem;
  font-size: 0.6875rem; /* ~11px */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

table:not(.items-table):not(.doc-items-table) thead tr {
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.table-body-row,
table:not(.items-table):not(.doc-items-table) tbody tr {
  transition: background-color 0.12s ease;
  border-bottom: 1px solid #f1f5f9;
}

/* Subtle Zebra Striping */
table:not(.items-table):not(.doc-items-table) tbody tr:nth-child(odd),
table:not(.items-table):not(.doc-items-table) tbody tr:nth-child(odd) td,
tbody.bg-white tr:nth-child(odd) td,
.table-body-row:nth-child(odd) .table-body-cell {
  background-color: #ffffff;
}

table:not(.items-table):not(.doc-items-table) tbody tr:nth-child(even),
table:not(.items-table):not(.doc-items-table) tbody tr:nth-child(even) td,
tbody.bg-white tr:nth-child(even) td,
.table-body-row:nth-child(even) .table-body-cell {
  background-color: #f8fafc;
}

/* Subtle Row Hover State */
table:not(.items-table):not(.doc-items-table) tbody tr:hover,
table:not(.items-table):not(.doc-items-table) tbody tr:hover td,
.table-body-row:hover,
.table-body-row:hover .table-body-cell,
tbody.bg-white tr:hover td {
  background-color: #fdf8ee;
}

.table-body-cell,
table tbody td {
  padding: 0.8125rem 1rem;
  font-size: 0.8125rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

/* Button System */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5625rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #090d16;
  background: #b47828;
  background: linear-gradient(135deg, #dca048 0%, #b47828 100%);
  border: 1px solid #9c641d;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgba(180, 120, 40, 0.2);
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #e4ad57 0%, #a2691e 100%);
  box-shadow: 0 4px 10px 0 rgba(180, 120, 40, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5625rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.1);
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn-secondary:hover {
  background-color: #1e293b;
  border-color: #334155;
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0.625rem;
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn-outline:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-danger-subtle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #b91c1c;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.625rem;
  transition: all 0.15s ease;
}
.btn-danger-subtle:hover {
  background-color: #fee2e2;
  border-color: #fca5a5;
}

/* Form Controls */
.form-input {
  width: 100%;
  padding: 0.5625rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 400;
  color: #0f172a;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0.625rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus {
  outline: none;
  border-color: #b47828;
  box-shadow: 0 0 0 3px rgba(180, 120, 40, 0.15);
}
.form-label {
  display: block;
  font-size: 0.6875rem; /* ~11px */
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Status Chips / Badges */
.badge-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.5625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #8a5818;
  background-color: #fef9ee;
  border: 1px solid #fae3b4;
  border-radius: 9999px;
}
.badge-emerald {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.5625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #065f46;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 9999px;
}
.badge-sky {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.5625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #0369a1;
  background-color: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 9999px;
}
.badge-purple {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.5625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b21a8;
  background-color: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 9999px;
}
.badge-rose {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.5625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #9f1239;
  background-color: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 9999px;
}
.badge-slate {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.5625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #334155;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
}

/* Document A4 Canvas & Anchored Footer Layout */
.doc-page-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(297mm - 32mm);
  width: 100%;
  box-sizing: border-box;
}

.doc-content-body {
  flex: 1 0 auto;
  width: 100%;
}

.doc-bottom-section {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 20px;
  width: 100%;
}

