/* =====================================================================
   ORARI DIY — LAPISAN DESAIN BERSAMA (dimuat oleh semua halaman)
   Tujuan: tampilan modern & konsisten di seluruh portal tanpa mengubah
   struktur HTML / logika halaman. Semua aturan memakai prefix `html`
   agar menang atas utilitas Tailwind CDN yang disuntikkan belakangan.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --o-brand: #b91c1c;          /* merah ORARI */
  --o-brand-strong: #991b1b;
  --o-brand-soft: #fef2f2;
  --o-ink: #0f172a;
  --o-ink-2: #334155;
  --o-muted: #64748b;
  --o-line: #e2e8f0;
  --o-line-strong: #cbd5e1;
  --o-surface: #ffffff;
  --o-canvas: #f6f7f9;
  --o-ring: rgba(185, 28, 28, 0.28);
  --o-radius-sm: 10px;
  --o-radius: 14px;
  --o-radius-lg: 20px;
  --o-shadow-1: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 1px rgba(15, 23, 42, 0.03);
  --o-shadow-2: 0 8px 24px -12px rgba(15, 23, 42, 0.18), 0 2px 6px -2px rgba(15, 23, 42, 0.06);
  --o-shadow-3: 0 24px 48px -16px rgba(15, 23, 42, 0.28);
  --o-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --o-header: #111318;
}

/* ---------- Dasar & tipografi ---------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--o-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
html body.bg-slate-50, html body.bg-stone-50, html body.bg-gray-50, html body.bg-slate-100 { background-color: var(--o-canvas); }
html .font-mono, html code, html kbd { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Batas bawah ukuran teks: label 9–10px sulit dibaca, terutama di ponsel */
html .text-\[8px\], html .text-\[9px\] { font-size: 10.5px; line-height: 1.35; }
html .text-\[10px\] { font-size: 11px; line-height: 1.4; }
html .text-\[11px\] { font-size: 12px; line-height: 1.45; }
html .text-xs { line-height: 1.5; }

/* Font-black terasa berat di banyak tempat; turunkan sedikit agar hierarki lebih tenang */
html .font-black { font-weight: 800; letter-spacing: -0.01em; }
html h1, html h2, html h3 { letter-spacing: -0.02em; }
html .uppercase.tracking-wider, html .uppercase.tracking-widest { letter-spacing: 0.06em; }

/* ---------- Header utama ---------- */
html header.sticky,
html header[class*="from-red-8"],
html header[class*="from-red-9"] {
  background: rgba(17, 19, 24, 0.92);
  background-image: none;
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 -2px 0 0 var(--o-brand);
}
html header .text-red-200, html header .text-red-100 { color: #cbd5e1; }
html header .border-red-700\/60, html header .border-red-700\/50 { border-color: rgba(255, 255, 255, 0.1); }

/* Bilah status sinkronisasi: lebih tipis & tenang */
html #barSinkronisasiServer { font-size: 11px; background: #0b0d11; border-bottom-color: rgba(255,255,255,0.05); }

/* ---------- Kartu & permukaan ---------- */
html .rounded-3xl { border-radius: var(--o-radius-lg); }
html .rounded-2xl { border-radius: var(--o-radius); }
html .rounded-xl  { border-radius: var(--o-radius-sm); }

html main .bg-white.border,
html main .bg-white.border-2 {
  border-width: 1px;
  border-color: var(--o-line);
  box-shadow: var(--o-shadow-1);
}
html main .bg-white.border-2[class*="hover:border-"]:hover { border-color: var(--o-line-strong); }
html main .grid > .bg-white.rounded-3xl,
html main .grid > .bg-white.rounded-2xl {
  transition: transform .25s var(--o-ease), box-shadow .25s var(--o-ease), border-color .2s ease;
}
html main .grid > .bg-white.rounded-3xl:hover,
html main .grid > .bg-white.rounded-2xl:hover {
  transform: translateY(-3px);
  box-shadow: var(--o-shadow-2);
}
html .shadow-xl, html .shadow-2xl { box-shadow: var(--o-shadow-3); }
html .hover\:shadow-xl:hover { box-shadow: var(--o-shadow-2); }

/* ---------- Tombol ---------- */
html button, html a, html [role="button"] {
  -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease,
              box-shadow .18s ease, transform .18s var(--o-ease), opacity .18s ease;
}
html button:not(:disabled):active, html a[class*="bg-"]:active { transform: scale(0.98); }
html button:disabled, html button[disabled] { opacity: .55; cursor: not-allowed; }

/* Tombol utama merah: warna rata yang konsisten */
html .bg-red-700, html .bg-red-600 { background-color: var(--o-brand); }
html .hover\:bg-red-800:hover, html .hover\:bg-red-700:hover { background-color: var(--o-brand-strong); }

/* Fokus keyboard yang terlihat jelas di semua kontrol */
html :focus { outline: none; }
html :focus-visible {
  outline: 2px solid var(--o-brand);
  outline-offset: 2px;
  border-radius: 8px;
}
html header :focus-visible { outline-color: #fbbf24; }

/* ---------- Form ---------- */
html input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
html select,
html textarea {
  border-color: var(--o-line-strong);
  border-radius: var(--o-radius-sm);
  background-color: #fff;
  color: var(--o-ink);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
html input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):hover,
html select:hover, html textarea:hover { border-color: #94a3b8; }
html input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
html select:focus, html textarea:focus {
  border-color: var(--o-brand);
  box-shadow: 0 0 0 4px var(--o-ring);
  outline: none;
}
html input::placeholder, html textarea::placeholder { color: #94a3b8; }
html input[type="checkbox"], html input[type="radio"] { accent-color: var(--o-brand); width: 1rem; height: 1rem; }
html input[type="file"] { font-size: 12px; }
html input[type="file"]::file-selector-button {
  margin-right: .75rem; padding: .45rem .8rem; border: 1px solid var(--o-line-strong);
  border-radius: 8px; background: #f8fafc; color: var(--o-ink-2); font-weight: 600; cursor: pointer;
}
html input[type="file"]::file-selector-button:hover { background: #f1f5f9; }
html label { color: var(--o-ink-2); }

/* ---------- Tabel ---------- */
html table { border-collapse: separate; border-spacing: 0; }
html thead th {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--o-muted);
}
html tbody tr { transition: background-color .15s ease; }
html tbody tr:hover { background-color: #f8fafc; }
html tbody td { border-color: #f1f5f9; }

/* ---------- Modal & overlay ---------- */
html .fixed.inset-0[class*="bg-black"],
html .fixed.inset-0[class*="bg-slate-900"],
html .fixed.inset-0[class*="bg-slate-950"],
html .fixed.inset-0[class*="bg-stone-9"] {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
html .fixed.inset-0:not(.hidden) > div:first-child {
  animation: oModalIn .26s var(--o-ease) both;
}
@keyframes oModalIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Badge / chip ---------- */
html .rounded-full.uppercase { letter-spacing: .05em; }

/* Animasi berkedip pada tombol terasa mengganggu: ganti dengan titik penanda halus */
html button.animate-pulse, html a.animate-pulse { animation: none; box-shadow: 0 0 0 0 rgba(245, 158, 11, .55); animation: oPing 2.4s ease-out infinite; }
@keyframes oPing {
  0%   { box-shadow: 0 0 0 0 rgba(245, 158, 11, .5); }
  70%  { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* ---------- Scrollbar ---------- */
html ::-webkit-scrollbar { width: 10px; height: 10px; }
html ::-webkit-scrollbar-track { background: transparent; }
html ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; border: 3px solid var(--o-canvas); }
html ::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---------- Seleksi teks ---------- */
html ::selection { background: var(--o-brand); color: #fff; }

/* ---------- Ponsel: target sentuh lebih besar & tanpa scroll horizontal ---------- */
html body { overflow-x: hidden; }
@media (max-width: 640px) {
  html main button, html main a[class*="py-1"], html main a[class*="py-2"] { min-height: 40px; }
  html input:not([type="checkbox"]):not([type="radio"]), html select, html textarea { font-size: 16px; } /* cegah auto-zoom iOS */
  html .rounded-3xl { border-radius: 18px; }
}

/* ---------- Hormati preferensi gerak minimal ---------- */
@media (prefers-reduced-motion: reduce) {
  html *, html *::before, html *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Cetak ---------- */
@media print {
  html header, html #barSinkronisasiServer, html #orariBtnScrollTop { display: none !important; }
  html body { background: #fff; }
}

/* ===== MODE RINGAN: matikan efek berat agar halaman terasa cepat ===== */
*, *::before, *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.animate-ping, .animate-pulse, .animate-bounce, .animate-spin-slow { animation: none !important; }
html { scroll-behavior: auto !important; }
main .rounded-2xl.border, main .rounded-3xl.border { transition: none !important; }
body { background-attachment: scroll !important; }
@media (prefers-reduced-motion: no-preference) { main > div:not(.hidden) { animation: none !important; } }
#infoLatensiSync{display:none !important}

/* ===== TAMPILAN MODERN: form, kartu, tombol (lapisan akhir, ringan tanpa blur) ===== */
:root { --o-radius: 14px; --o-ring: 0 0 0 4px rgba(220,38,38,.14); }
html body { letter-spacing: -0.005em; }

/* Form: label jelas, kolom lega, status valid/tidak valid yang tegas */
html label { font-weight: 600; }
html form label.block, html form .block > label { margin-bottom: .35rem; }
html input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]),
html select, html textarea {
  min-height: 46px; border-radius: var(--o-radius) !important; border: 1.5px solid #cbd5e1 !important;
  background-color: #fff; padding-left: .9rem; padding-right: .9rem; font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
html textarea { min-height: 110px; line-height: 1.55; }
html input:focus, html select:focus, html textarea:focus { border-color: #dc2626 !important; box-shadow: var(--o-ring) !important; outline: none; }
html input:user-invalid, html select:user-invalid, html textarea:user-invalid { border-color: #e11d48 !important; background: #fff1f2; }
html input:disabled, html select:disabled, html textarea:disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }
html input[type="file"] { width: 100%; padding: .6rem; border: 1.5px dashed #cbd5e1; border-radius: var(--o-radius); background: #f8fafc; }
html input[type="file"]:hover { border-color: #dc2626; background: #fff; }

/* Tombol: tinggi nyaman, status memuat jelas */
html button[type="submit"], html form button.bg-red-600, html form button.bg-red-700 { min-height: 46px; border-radius: var(--o-radius); font-weight: 700; }
html button:disabled { opacity: .6; cursor: not-allowed; }
html button:focus-visible, html a:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }

/* Kartu: sudut besar, bayangan halus, tanpa efek hover berat */
html main .rounded-2xl, html main .rounded-3xl { border-radius: 18px; }
html main section.bg-white, html main article.bg-white { box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 18px -10px rgba(15,23,42,.12); }

/* Index: ritme ruang lebih lega, judul lebih tegas */
html main h2, html main h3 { letter-spacing: -0.02em; }
@media (min-width: 1024px) { html main { --tw-space-y: 0; } }
@media (max-width: 640px) { html main { padding-left: 1rem; padding-right: 1rem; } html h2 { line-height: 1.15; } }

/* Tabel & modal ramping */
html table th { font-size: .72rem; letter-spacing: .06em; }
html [id^="modal"] > div { border-radius: 20px; }
