/* Oyi Group theme v2 (fun F&B: krem hangat, hijau hangat, aksen kuning brand #FFF500, judul Fredoka)
   Sebelumnya: theme v1 — dipakai bersama oleh OPS, SCM, dan FNA.
   Sumber tunggal: oyi-fna/finance_sync_portal/static/oyi-theme/. Salin ke aplikasi lain dengan
   tools/export_oyi_theme.py (jangan edit salinannya). Penyesuaian per aplikasi ada di file adapter masing-masing. */

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 300 800;
  src: url(fonts/open-sans-latin-wght-normal.woff2) format('woff2-variations'), url(fonts/open-sans-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 300 800;
  src: url(fonts/open-sans-latin-ext-wght-normal.woff2) format('woff2-variations'), url(fonts/open-sans-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url(fonts/fredoka-latin-wght-normal.woff2) format('woff2-variations'), url(fonts/fredoka-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url(fonts/fredoka-latin-ext-wght-normal.woff2) format('woff2-variations'), url(fonts/fredoka-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
  color-scheme: light;
  --oyi-font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --oyi-font-mono: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;

  /* Ukuran huruf */
  --oyi-text-xs: 11px;
  --oyi-text-sm: 12px;
  --oyi-text-base: 14px;
  --oyi-text-md: 15px;
  --oyi-text-lg: 17px;
  --oyi-text-xl: 22px;
  --oyi-text-num: 24px;
  --oyi-leading: 1.55;

  /* Permukaan & teks */
  --oyi-paper: #f8f9fa;
  --oyi-surface: #ffffff;
  --oyi-surface-2: #f1f3f4;
  --oyi-sidebar: #f8f9fa;
  --oyi-hover: #eceff1;
  --oyi-line: #e3e6ea;
  --oyi-line-strong: #cdd2d8;
  --oyi-ink: #202124;
  --oyi-ink-2: #3c4043;
  --oyi-muted: #5f6368;

  /* Aksen hijau Oyi */
  --oyi-green: #3c7a2a;
  --oyi-green-strong: #2d5e1f;
  --oyi-green-soft: #e8f3e1;
  --oyi-green-ink: #2a5320;
  --oyi-ring: 0 0 0 3px rgba(60, 122, 42, .3);
  --oyi-on-green: #ffffff;
  /* Kuning brand Oyi: untuk sorotan (kartu utama, menu aktif, switcher, banner). Teks di atasnya selalu gelap. */
  --oyi-yellow: #fff500;
  --oyi-yellow-soft: #fff9b0;
  --oyi-yellow-line: #e3d400;
  --oyi-yellow-ink: #3d3700;
  --oyi-font-display: 'Fredoka', 'Open Sans', system-ui, sans-serif;

  /* Status (selalu dengan teks/ikon, bukan warna saja) */
  --oyi-danger: #c2362b;
  --oyi-danger-strong: #9e2a21;
  --oyi-danger-soft: #fdecea;
  --oyi-warning: #8f5b00;
  --oyi-warning-soft: #fef3d6;
  --oyi-info: #2b67a8;
  --oyi-info-soft: #e8f0fe;

  /* Merek & kanal */
  --oyi-brand-red: #e30613;
  --oyi-blue: #2373bc;
  --oyi-teal: #157f83;
  --oyi-gofood: #df3548;
  --oyi-grab: #00a65a;
  --oyi-shopee: #ed692b;

  /* Bentuk */
  --oyi-radius-sm: 8px;
  --oyi-radius: 12px;
  --oyi-radius-lg: 16px;
  --oyi-shadow: 0 1px 0 rgba(32, 33, 36, .05), 0 8px 24px -18px rgba(32, 33, 36, .28);
  --oyi-shadow-pop: 0 18px 40px -20px rgba(32, 33, 36, .35);
  --oyi-control-h: 38px;
  --oyi-sidebar-w: 248px;

  /* Nama lama yang masih dipakai panel bersama */
  --oyi-ink-legacy: var(--oyi-ink);
}

/* Satu jenis huruf di semua elemen (kecuali kode). */
html body,
html body *:not(code):not(pre):not(kbd):not(samp):not(.mono):not(.oyi-mono) {
  font-family: var(--oyi-font) !important;
}
html body code, html body pre, html body kbd, html body samp, html body .mono, html body .oyi-mono {
  font-family: var(--oyi-font-mono) !important;
}

/* Judul bergaya Oyi (Fredoka, membulat seperti logo); isi & angka tetap Open Sans agar nyaman dibaca. */
html body :is(h1, h2, h3, .oyi-display):not(code):not(pre):not(kbd):not(samp):not(.mono):not(.oyi-mono) {
  font-family: var(--oyi-font-display) !important; letter-spacing: .1px;
}
h1 { font-weight: 600; } h2, h3 { font-weight: 600; }

/* Mode gelap netral (charcoal, aksen hijau mint), dipakai shell bersama lewat html[data-work-theme=dark]. */
html[data-work-theme=dark] {
  color-scheme: dark;
  --oyi-paper: #121212; --oyi-surface: #1e1e1e; --oyi-surface-2: #252525; --oyi-sidebar: #181818; --oyi-hover: #2c2c2c;
  --oyi-line: #2f2f2f; --oyi-line-strong: #454545; --oyi-ink: #e0e0e0; --oyi-ink-2: #c4c4c4; --oyi-muted: #9e9e9e;
  --oyi-green: #8fd9a8; --oyi-green-strong: #b4ebc6; --oyi-green-soft: #1d3326; --oyi-green-ink: #b9ebcb; --oyi-on-green: #121212;
  --oyi-ring: 0 0 0 3px rgba(143, 217, 168, .35);
  --oyi-yellow: #fff500; --oyi-yellow-soft: #33301a; --oyi-yellow-line: #a39a00; --oyi-yellow-ink: #fff7a0;
  --oyi-danger: #ff9e8f; --oyi-danger-strong: #ffb8ab; --oyi-danger-soft: #3a1f1d; --oyi-warning: #f5c66b; --oyi-warning-soft: #362d1a;
  --oyi-info: #9cc6f2; --oyi-info-soft: #1b2a3a;
  --oyi-shadow: 0 1px 0 rgba(0, 0, 0, .3); --oyi-shadow-pop: 0 18px 40px -20px rgba(0, 0, 0, .75);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-size: var(--oyi-text-base);
  line-height: var(--oyi-leading);
  color: var(--oyi-ink);
  background: var(--oyi-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: 0;
}
h1 { font-size: var(--oyi-text-xl); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; color: var(--oyi-ink); }
h2 { font-size: var(--oyi-text-lg); font-weight: 600; line-height: 1.35; color: var(--oyi-ink); }
h3 { font-size: var(--oyi-text-md); font-weight: 600; line-height: 1.4; color: var(--oyi-ink); }
small { font-size: var(--oyi-text-sm); }
strong, b { font-weight: 600; }
:where(a) { color: var(--oyi-green); }
:where(a):hover { color: var(--oyi-green-strong); }
button, input, select, textarea { font: inherit; font-size: inherit; letter-spacing: 0; }
input::placeholder, textarea::placeholder { color: #8c9791; opacity: 1; }
table { font-variant-numeric: tabular-nums; }
th { font-weight: 600; color: var(--oyi-muted); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--oyi-green); outline-offset: 2px; }
::selection { background: #cfe8da; color: var(--oyi-ink); }

/* Ikon Lucide: ketebalan dan ukuran sama di ketiga aplikasi. */
svg.lucide, .lucide, svg.ws-icon { stroke-width: 1.75; }

/* Switcher OPS / SCM / FNA — tampilan sama di ketiga aplikasi. */
.oyi-app-switcher, .ops-header .ops-app-switcher, .oyi-app-bar nav {
  display: flex; align-items: center; gap: 2px;
}
.oyi-app-switcher a, .ops-header .ops-app-switcher a, .oyi-app-bar nav a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px;
  font-size: var(--oyi-text-sm); font-weight: 600; color: var(--oyi-muted) !important;
  text-decoration: none; border-bottom: 2px solid transparent; border-radius: 0;
}
.oyi-app-switcher a:hover, .ops-header .ops-app-switcher a:hover, .oyi-app-bar nav a:hover { color: var(--oyi-ink) !important; }
.oyi-app-switcher a[aria-current=page], .ops-header .ops-app-switcher a[aria-current=page], .oyi-app-bar nav a[aria-current=page] {
  color: var(--oyi-green) !important; border-bottom-color: var(--oyi-green);
}
.oyi-app-switcher svg, .ops-header .ops-app-switcher svg, .oyi-app-bar nav svg { width: 15px; height: 15px; flex: none; }

/* Komponen bersama (bisa dipakai langsung di halaman baru). */
.oyi-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--oyi-control-h); padding: 0 14px; border-radius: var(--oyi-radius);
  border: 1px solid var(--oyi-green); background: var(--oyi-green); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none;
}
.oyi-btn:hover { background: var(--oyi-green-strong); border-color: var(--oyi-green-strong); color: #fff; }
.oyi-btn--secondary { background: var(--oyi-surface); color: var(--oyi-ink-2); border-color: var(--oyi-line-strong); }
.oyi-btn--secondary:hover { background: var(--oyi-green-soft); color: var(--oyi-green-ink); border-color: #a9c9b7; }
.oyi-btn--danger { background: var(--oyi-danger); border-color: var(--oyi-danger); }
.oyi-btn--danger:hover { background: var(--oyi-danger-strong); border-color: var(--oyi-danger-strong); }
.oyi-btn:disabled, .oyi-btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.oyi-card { background: var(--oyi-surface); border: 1px solid var(--oyi-line); border-radius: var(--oyi-radius-lg); box-shadow: var(--oyi-shadow); padding: 16px 18px; }

/* Halaman login bersama: .oyi-login > .oyi-login-card */
.oyi-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--oyi-paper); box-sizing: border-box; }
.oyi-login-card { width: 100%; max-width: 380px; box-sizing: border-box; background: var(--oyi-surface); border: 1px solid var(--oyi-line); border-radius: 12px; box-shadow: var(--oyi-shadow-pop); padding: 32px 28px 26px; }
.oyi-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.oyi-login-brand img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.oyi-login-brand strong { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--oyi-ink); }
.oyi-login-brand span { display: block; font-size: var(--oyi-text-sm); color: var(--oyi-muted); }
.oyi-login-card h1 { font-size: var(--oyi-text-lg); font-weight: 600; margin: 0 0 4px; }
.oyi-login-card .oyi-login-lead { font-size: 13px; color: var(--oyi-muted); margin: 0 0 18px; }
.oyi-login-card label { display: block; font-size: var(--oyi-text-sm); font-weight: 600; color: var(--oyi-ink-2); margin: 14px 0 6px; }
.oyi-login-card input[type=text], .oyi-login-card input[type=password] {
  display: block; width: 100%; box-sizing: border-box; min-height: 42px; padding: 8px 12px; border: 1px solid var(--oyi-line-strong);
  border-radius: var(--oyi-radius); background: var(--oyi-surface); color: var(--oyi-ink); font-size: var(--oyi-text-base);
}
.oyi-login-card input:focus { outline: none; border-color: var(--oyi-green); box-shadow: var(--oyi-ring); }
.oyi-login-card .oyi-btn { width: 100%; min-height: 44px; margin-top: 20px; font-size: var(--oyi-text-base); }
.oyi-login-card a.oyi-btn { margin-top: 0; }
.oyi-login-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 2px; font-size: var(--oyi-text-sm); color: var(--oyi-muted); }
.oyi-login-or::before, .oyi-login-or::after { content: ''; flex: 1; border-top: 1px solid var(--oyi-line); }
.oyi-login-error { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--oyi-radius); background: var(--oyi-danger-soft); color: var(--oyi-danger); font-size: 13px; }
.oyi-login-foot { margin: 20px 0 0; text-align: center; font-size: var(--oyi-text-xs); color: var(--oyi-muted); }

/* ---- Komponen fun F&B (dipakai OPS/SCM/FNA) ---- */
.oyi-mascot {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 0 0 16px;
  background: var(--oyi-yellow-soft); border: 2px dashed var(--oyi-yellow-line); border-radius: var(--oyi-radius-lg);
  color: var(--oyi-yellow-ink); font-size: var(--oyi-text-base); line-height: 1.5;
}
.oyi-mascot[hidden] { display: none !important; }
.oyi-mascot .oyi-mascot-face { font-size: 28px; line-height: 1; flex: none; }
.oyi-mascot b { font-weight: 700; }
.oyi-mascot small { display: block; color: var(--oyi-yellow-ink); opacity: .8; font-size: var(--oyi-text-xs); }
.oyi-kpi-hero, html[data-work-theme] .oyi-kpi-hero.oyi-kpi-hero.oyi-kpi-hero { background: var(--oyi-yellow) !important; border-color: var(--oyi-yellow-line) !important; color: #2b2118 !important;
  box-shadow: 0 4px 0 var(--oyi-yellow-line) !important; }
.oyi-kpi-hero :is(h2, h3, span, small, strong, b, p), html[data-work-theme] .oyi-kpi-hero.oyi-kpi-hero.oyi-kpi-hero :is(h2, h3, span, small, strong, b, p) { color: #2b2118 !important; }
.oyi-chip-on { background: var(--oyi-green) !important; border-color: var(--oyi-green) !important; color: var(--oyi-on-green) !important; }

@media (max-width: 600px) {
  h1 { font-size: 20px; }
  .oyi-app-switcher a, .ops-header .ops-app-switcher a, .oyi-app-bar nav a { padding: 0 7px; }
}
@media (pointer: coarse) {
  .oyi-btn { min-height: 44px; }
}
