/* =========================================================
   GAZKOO INDUSTRIAL PRECISION × APPLE CRAFT — DESIGN TOKENS
   4-Layer Functional Color System · Inter Optical Sizing
   ========================================================= */
:root {
  /* GazKoo Canonical ERP Palette (60 / 20 / 15 / 5) */
  --erp-canvas: #F4F7F5;       /* 60% latar utama */
  --erp-surface: #FFFFFF;      /* 20% kartu & tabel */
  --erp-border: #DCE3DF;       /* garis pemisah tabel */
  --erp-primary: #133628;      /* 15% sidebar & heading otoritatif */
  --erp-accent: #FD850B;       /* 5% CTA utama & sorotan status */
  --erp-success: #19561F;      /* status Sepakat / COA valid */

  /* Layer 1: Neutral Surface & Border */
  --gz-canvas: var(--erp-canvas);
  --gz-surface: var(--erp-surface);
  --gz-border: var(--erp-border);

  /* Layer 2: Typography Scale */
  --gz-text-primary: var(--erp-primary);
  --gz-text-secondary: #475569;
  --gz-text-muted: #64748b;
  --gz-text-placeholder: #94a3b8;

  /* Layer 3: Brand Primary & Status */
  --gz-emerald: var(--erp-success);
  --gz-forest: var(--erp-primary);
  --gz-charcoal: var(--erp-primary);

  /* Layer 4: Semantic Status & Accent */
  --gz-info: var(--erp-primary);
  --gz-warn: var(--erp-accent);
  --gz-highlight: var(--erp-accent);

  /* Authoritative Deep Forest Sidebar */
  --gz-sidebar-mesh: var(--erp-primary);

  /* Industrial Geometry (crisp, non-bubbly) */
  --gz-radius-card: 6px;
  --gz-radius-control: 6px;
  --gz-radius-sm: 4px;

  /* Apple Craft Calibrated Motion (critically damped, zero overshoot) */
  --gz-ease-apple: cubic-bezier(0.22, 1, 0.36, 1);
  --gz-dur-press: 100ms;
  --gz-dur-panel: 240ms;

  /* Translucent Sticky Chrome */
  --gz-chrome-bg: rgba(244, 247, 245, 0.85);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  line-height: 1.5;
  font-weight: 400;
  color: var(--gz-text-primary);
  background-color: var(--gz-canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--gz-canvas);
  color: var(--gz-text-primary);
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  overflow-x: clip;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p {
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
}

table,
td,
th,
input[type='number'],
.gz-tabular {
  font-variant-numeric: tabular-nums;
}

button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

/* Apple Craft: Instant Pointer-Down Tactile Feedback */
button:not(:disabled) {
  transition:
    background-color var(--gz-dur-press) ease-out,
    border-color var(--gz-dur-press) ease-out,
    color var(--gz-dur-press) ease-out,
    transform var(--gz-dur-press) ease-out,
    opacity var(--gz-dur-press) ease-out;
}

button:not(:disabled):active {
  transform: scale(0.98);
}

/* Keyboard Focus Ring (WCAG 2.2 + Apple Accessibility) */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gz-emerald);
  outline-offset: 2px;
}

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

/* Spatial Consistency Animations (Trigger-Origin, Critically Damped) */
@keyframes gzPanelReveal {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gzModalReveal {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Respect Reduced Motion & Reduced Transparency (Apple Accessibility) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  button:not(:disabled):active {
    transform: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --gz-chrome-bg: #f4f7f5;
  }
}
