/* ==========================================================================
   Engineering OS · ERP (ERPNext Theme)
   Follows docs/design-system.md -> "ERP (ERPNext, restyled)"
   ========================================================================== */

/* 1. Local Fonts */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/acs_erp/fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/acs_erp/fonts/Inter-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/acs_erp/fonts/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/acs_erp/fonts/JetBrainsMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/acs_erp/fonts/JetBrainsMono-Medium.woff2') format('woff2');
}

/* 2. Frappe / ERPNext Design Tokens Override */
:root,
[data-theme="light"],
body {
  /* Typography */
  --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-family: var(--font-stack) !important;

  /* Surfaces & Floor */
  --bg-color: #f7f7f4 !important;
  --fg-color: #ffffff !important;
  --text-color: #1a1a19 !important;
  --text-muted: #6b6b66 !important;
  --text-light: #9e9e98 !important;

  --card-bg: #ffffff !important;
  --control-bg: #ffffff !important;
  --control-bg-on-gray: #ffffff !important;
  --modal-bg: #ffffff !important;
  --subtle-accent: #f7f7f4 !important;
  --subtle-fg: #f7f7f4 !important;

  /* Blue tokens neutralized to neutral/ink (design system: no blue) */
  --surface-blue-1: #f7f7f4 !important;
  --surface-blue-2: #f0f0ea !important;
  --surface-blue-3: #1a1a19 !important;
  --bg-blue: #f7f7f4 !important;
  --bg-light-blue: #f7f7f4 !important;
  --outline-blue-1: #d8d8d0 !important;

  /* Borders & Hairlines */
  --border-color: #e5e5df !important;
  --subtle-border-color: #f0f0ea !important;
  --dark-border-color: #d8d8d0 !important;
  --table-border-color: #e5e5df !important;

  /* Primary Accent: Cursor Orange (One CTA per screen) */
  --primary-color: #e3441a !important;
  --primary: #e3441a !important;
  --primary-hover: #cf3a13 !important;

  /* Semantic Hues */
  --error-color: #d93025 !important;
  --success-color: #0f9d58 !important;
  --warning-color: #d93025 !important;

  /* Corner Radii: 8px controls, 12px cards/modals, 9999px pills */
  --border-radius-xs: 4px !important;
  --border-radius-sm: 4px !important;
  --border-radius: 8px !important;
  --border-radius-md: 8px !important;
  --border-radius-lg: 12px !important;
  --border-radius-full: 9999px !important;
  --btn-border-radius: 8px !important;
  --card-border-radius: 12px !important;
  --modal-border-radius: 12px !important;

  /* Shadows: Completely eliminated (hairlines only) */
  --shadow-xs: none !important;
  --shadow-sm: none !important;
  --shadow-base: none !important;
  --shadow-md: none !important;
  --shadow-lg: none !important;
  --shadow-xl: none !important;
  --shadow-2xl: none !important;
  --card-shadow: none !important;
  --btn-shadow: none !important;
  --modal-shadow: none !important;
  --dropdown-shadow: none !important;
}

/* 3. Surface & Layout Refinements */
body {
  background-color: #f7f7f4 !important;
  color: #1a1a19 !important;
  -webkit-font-smoothing: antialiased;
}

.layout-main-section,
.page-container,
.main-section {
  background-color: transparent !important;
}

.desk-page,
.standard-filter-section,
.form-section,
.layout-side-section {
  background-color: transparent !important;
}

/* Cards & Modals: 12px radius, hairline border, no shadow */
.card,
.desk-card,
.modal-content,
.form-page,
.form-layout,
.workspace-sidebar,
.widget-group,
.dashboard-widget-box {
  box-shadow: none !important;
  border: 1px solid #e5e5df !important;
  border-radius: 12px !important;
}

.modal-content {
  border-radius: 12px !important;
}

/* 4. Controls & Input Fields (F12)
   1px hairline-strong border (#d8d8d0), 8px radius, white surface, ink focus ring */
.form-control,
.input-with-feedback,
.custom-actions,
.btn {
  border-radius: 8px !important;
  box-shadow: none !important;
}

.form-control,
.input-with-feedback,
input.form-control,
select.form-control,
textarea.form-control {
  border: 1px solid #d8d8d0 !important;
  background-color: #ffffff !important;
  color: #1a1a19 !important;
}

.form-control:focus,
.input-with-feedback:focus,
input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
  border-color: #1a1a19 !important;
  box-shadow: 0 0 0 1px #1a1a19 !important;
  outline: none !important;
}

/* Like-disabled inputs & static displays */
.like-disabled-input {
  border: 1px solid #e5e5df !important;
  border-radius: 8px !important;
  background-color: #f7f7f4 !important;
  color: #6b6b66 !important;
}

/* Buttons */
.btn-primary {
  background-color: #e3441a !important;
  border-color: #e3441a !important;
  color: #ffffff !important;
  font-weight: 500 !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #cf3a13 !important;
  border-color: #cf3a13 !important;
}

.btn-default,
.btn-secondary {
  background-color: #ffffff !important;
  border: 1px solid #e5e5df !important;
  color: #1a1a19 !important;
}

.btn-default:hover,
.btn-secondary:hover {
  background-color: #f0f0ea !important;
  border-color: #d8d8d0 !important;
}

/* 5. Child Tables / Form Grids (F12)
   Grid rows: surface (white) with hairline borders. Footer: cream with hairline top border. */
.form-grid {
  border: 1px solid #e5e5df !important;
  border-radius: 8px !important;
  background-color: #ffffff !important;
}

.grid-heading-row {
  border-bottom: 1px solid #e5e5df !important;
  background-color: #f7f7f4 !important;
  color: #6b6b66 !important;
}

.grid-heading-row .grid-row,
.grid-heading-row .row-check,
.grid-heading-row .row-index {
  background-color: #f7f7f4 !important;
  color: #6b6b66 !important;
}

.form-grid .grid-body {
  background-color: #ffffff !important;
}

.form-grid .grid-row,
.form-grid .data-row,
.form-grid .grid-body .data-row {
  background-color: #ffffff !important;
  color: #1a1a19 !important;
  border-bottom: 1px solid #e5e5df !important;
}

.form-grid .grid-body .data-row .row-check,
.form-grid .grid-body .data-row .row-index,
.form-grid .grid-body .grid-static-col {
  background-color: #ffffff !important;
  color: #1a1a19 !important;
}

.form-grid .grid-footer,
.form-grid .grid-custom-buttons {
  background-color: #f7f7f4 !important;
  border-top: 1px solid #e5e5df !important;
  padding: 8px 12px !important;
}

/* 6. Onboarding suppression (F12)
   Hide Getting Started onboarding panel, sidebar entry, and onboarding widgets */
.onb-panel,
.user-onboarding,
.onboarding-sidebar,
.widget.onboarding,
[data-name="Welcome Workspace"] {
  display: none !important;
}

/* 7. Desk tiles & workspace icons neutralized (F12, F12b, F12c)
   Replace bright blue desktop tiles and sidebar workspace icons with neutral / ink.
   App icons are SVGs: a blue (#0289F7) tile with a white symbol. grayscale + high contrast
   turns the tile near-ink and keeps the symbol white (brightness alone darkened both).
   The ACS logo in the top bar (.navbar-home img) is not matched and keeps its colours. */
.desktop-icon .icon-container,
.sidebar-header .sidebar-item-icon,
.header-logo-container {
  background-color: #f0f0ea !important;
}

.desktop-alphabet,
.desktop-icon .icon,
.sidebar-header .sidebar-item-icon svg,
.sidebar-header .header-logo svg {
  color: #1a1a19 !important;
}

.icon-container img.app-icon,
.desktop-icon img.app-icon,
.header-logo img,
.sidebar-header img,
.sidebar-item-icon img,
.dropdown-menu-item .sidebar-item-icon img {
  filter: grayscale(1) contrast(8) brightness(0.9) !important;
}

/* 8. Chart colors (F12, F12b)
   Map line graph stroke and dots to ink (#1a1a19) and neutral (#6b6b66) instead of pink.
   Neutralize area fill under the line to transparent ink (#1a1a19 at low opacity). */
.chart-container path.line-graph-path {
  stroke: #1a1a19 !important;
}

.chart-container path.region-fill {
  fill: #1a1a19 !important;
  fill-opacity: 0.08 !important;
}

.chart-container defs linearGradient stop {
  stop-color: #1a1a19 !important;
}

.chart-container .dataset-units circle {
  fill: #1a1a19 !important;
  stroke: #ffffff !important;
}

.chart-container .legend-dataset-label {
  color: #6b6b66 !important;
}

/* 9. Monospace font for document numbers and codes */
.indicator-pill,
.badge {
  border-radius: 9999px !important;
}

.ellipsis[title*="SO-"],
.ellipsis[title*="WO-"],
.ellipsis[title*="ACS-"],
.ellipsis[title*="MAT-"],
.ellipsis[title*="ITEM-"],
.data-row .list-row-col:first-child .ellipsis {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
}

/* 10. Navbar styling: clean, warm floor */
.navbar {
  background-color: #ffffff !important;
  border-bottom: 1px solid #e5e5df !important;
  box-shadow: none !important;
}

.navbar .navbar-brand {
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* 11. Login page adjustments (F12) */
.for-login-with-email-link,
.form-login-with-email-link,
.btn-login-with-email-link {
  display: none !important;
}

/* 12. "Powered by" footer suppression across web pages (F13) */
.footer-powered,
.web-footer .footer-powered,
.powered-by-erpnext,
.powered-by-frappe,
a[href*="erpnext.com"],
a[href*="frappeframework.com"] {
  display: none !important;
}


