/* ============================================================
   CekSaham — tema "Senja" (selaras morninglabs.id / saham.morninglabs.id)
   Palet: navy #1d2a44 · krem #fdf8ef · teal #0f7a65 · coral #f2795d · sun #ffd27a
   Warna Tailwind (emerald/gray) di-remap di tailwind.config pada _Layout,
   jadi semua halaman lama otomatis ikut tema. File ini = komponen + suasana.
   ============================================================ */
:root {
  --navy: #1d2a44; --muted: #4a5672; --dim: #57627c;
  --teal: #0f7a65; --teal-h: #0b6352; --teal-s: #dff3ec; --teal-m: #c8ecdd;
  --coral: #f2795d; --coral-d: #a8432a; --coral-s: #ffe4da;
  --sun: #ffd27a; --sun-d: #8a5a00; --sun-s: #fff1cf;
  --paper: #fdf8ef; --card: #fffdf9; --line: #efe3d6; --line2: #e4d5c5;
  --sh-1: 0 1px 2px rgba(29,42,68,.04), 0 8px 24px -14px rgba(29,42,68,.16);
  --sh-2: 0 2px 4px rgba(29,42,68,.04), 0 24px 48px -24px rgba(29,42,68,.28);
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.2,.8,.2,1);
}

html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--navy);
  background:
    radial-gradient(900px 420px at 88% -120px, rgba(255,210,122,.35), rgba(255,210,122,0) 70%),
    radial-gradient(800px 380px at -10% -140px, rgba(242,121,93,.14), rgba(242,121,93,0) 70%),
    linear-gradient(180deg, #fff1e5 0px, #fdf8ef 420px) no-repeat,
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* Judul halaman pakai serif senja (tanpa merusak h1 yang memang sans di komponen) */
main h1:not(.font-sans) { font-family: var(--serif); font-weight: 400 !important; letter-spacing: -.01em; }
.font-display { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.tabular, td, .num { font-variant-numeric: tabular-nums; }

/* Kartu putih lama → kartu krem lembut */
main .bg-white { background-color: var(--card); }
main .shadow-sm, main .shadow { box-shadow: var(--sh-1) !important; }
main .shadow-lg, main .shadow-xl { box-shadow: var(--sh-2) !important; }
main .border, main .border-b, main .border-t, main .border-gray-100, main .border-gray-200 { border-color: var(--line); }

/* Tabel: header navy lembut, baris zebra hangat */
main table thead { background: #f8efe3; }
main table thead th { color: var(--muted); letter-spacing: .04em; }
main table tbody tr:hover { background: #fff6ea; }

/* Input & select */
main input[type=text], main input[type=search], main input[type=email], main input[type=password],
main input[type=number], main input[type=date], main select, main textarea {
  background-color: #fffdf9; border-color: var(--line2);
}
main input:focus, main select:focus, main textarea:focus {
  outline: none; border-color: var(--teal) !important;
  box-shadow: 0 0 0 4px rgba(15,122,101,.14) !important;
}

/* ---------- Header pill ---------- */
.sj-hdr { position: sticky; top: 0; z-index: 40; padding: 12px 16px 0; }
.sj-bar {
  max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 10px 0 18px; border-radius: 999px;
  background: rgba(255,253,249,.82); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border: 1px solid rgba(239,227,214,.9); box-shadow: var(--sh-1);
}
.sj-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sj-brand img { width: 38px; height: 38px; }
.sj-brand b { display: block; font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.05; letter-spacing: -.01em; }
.sj-brand small { display: block; font-size: 11.5px; color: var(--dim); font-weight: 500; }
.sj-nav { display: none; align-items: center; gap: 2px; margin: 0 auto; }
@media (min-width: 1100px) { .sj-nav { display: flex; } }
.sj-nav a {
  padding: 8px 13px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease); white-space: nowrap;
}
.sj-nav a:hover { background: var(--teal-s); color: var(--teal); }
.sj-nav a.is-active { background: var(--navy); color: #fff; font-weight: 600; }
.sj-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (min-width: 1100px) { .sj-right { margin-left: 0; } }

.sj-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: 14.5px;
  background: var(--teal); color: #fff; border: 1px solid var(--teal);
  box-shadow: 0 10px 24px -10px rgba(15,122,101,.6);
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.sj-btn:hover { background: var(--teal-h); transform: translateY(-1px); }
.sj-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 14.5px;
  background: #fffdf9; color: var(--navy); border: 1px solid var(--line2);
  transition: border-color .2s var(--ease);
}
.sj-btn-ghost:hover { border-color: var(--navy); }
.sj-iconbtn {
  width: 44px; height: 44px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--navy); background: transparent;
}
.sj-iconbtn:hover { background: var(--teal-s); }
@media (min-width: 1100px) { .sj-burger { display: none; } }

.sj-user {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px 0 5px; border-radius: 999px;
  background: #fffdf9; border: 1px solid var(--line);
}
.sj-user:hover { border-color: var(--line2); }
.sj-ava {
  width: 34px; height: 34px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--sun) 0%, var(--coral) 100%); color: #fff; font-weight: 700; font-size: 14px;
}
.sj-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 240px; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--sh-2); z-index: 50;
}
.sj-menu a, .sj-menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; font-size: 14px; color: var(--navy); }
.sj-menu a:hover, .sj-menu button:hover { background: #fff3e6; }

/* Panel menu mobile/tablet */
.sj-sheet {
  max-width: 1240px; margin: 10px auto 0; padding: 10px; border-radius: 24px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--sh-2);
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
}
.sj-sheet a { padding: 12px 14px; border-radius: 14px; font-size: 15px; font-weight: 500; color: var(--navy); }
.sj-sheet a:hover { background: var(--teal-s); }
.sj-sheet a.is-active { background: var(--navy); color: #fff; }

/* ---------- Tab bar bawah (HP) ---------- */
.sj-tabs {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 45;
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 24px;
  background: rgba(29,42,68,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px -16px rgba(29,42,68,.55);
}
.sj-tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border-radius: 18px;
  color: #c5cbe0; font-size: 11px; font-weight: 600;
}
.sj-tabs a svg { width: 22px; height: 22px; }
.sj-tabs a.is-active { color: var(--navy); background: var(--sun); }
@media (min-width: 768px) { .sj-tabs { display: none; } }
@media (max-width: 767px) { body.has-tabs { padding-bottom: 92px; } }

/* ---------- Footer ---------- */
.sj-foot {
  margin-top: 64px; padding: 56px 16px 40px;
  background:
    radial-gradient(700px 300px at 85% 0%, rgba(255,210,122,.18), transparent 70%),
    linear-gradient(180deg, #24324f 0%, #1d2a44 100%);
  color: #c5cbe0; border-radius: 36px 36px 0 0;
}
.sj-foot a:hover { color: #fff; }
.sj-foot h4 { color: #fff; font-weight: 600; font-size: 14px; margin-bottom: 12px; }

/* ---------- Komponen bantu untuk halaman ---------- */
.sj-card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--sh-1); }
.sj-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px;
  background: #fffdf9; border: 1px solid var(--coral-s); color: var(--coral-d); font-size: 13px; font-weight: 600;
}
.sj-eyebrow i { width: 16px; height: 16px; border-radius: 999px; background: var(--coral); box-shadow: 0 0 0 4px var(--coral-s); }
.sj-underline { position: relative; white-space: nowrap; color: var(--teal); font-style: italic; }
.sj-underline::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: -.08em; height: .14em; border-radius: 999px;
  background: var(--coral); opacity: .85; transform: rotate(-1deg);
}
.sj-sun {
  width: 72px; height: 72px; border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #ffe7a8 0%, #ffd27a 55%, #f5b301 100%);
  box-shadow: 0 0 0 12px rgba(255,210,122,.25), 0 0 90px 36px rgba(255,206,140,.55);
}

/* Toast */
.toast-enter { animation: toastIn .3s ease-out; }
.toast-exit { animation: toastOut .3s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px) scale(.96); } }

/* Skeleton hangat */
.animate-pulse .bg-gray-200 { background-color: #f1e6d8; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
