/* ==========================================================================
   ARAH RISET — Arah Daya Consulting
   Palet: navy tua, putih, aksen emas. Kaca buram lembut ala perangkat Apple.
   ========================================================================== */

:root {
  --navy-900: #07172e;
  --navy-800: #0b2545;
  --navy-700: #13315c;
  --navy-600: #1d4e89;
  --navy-500: #2f6bb0;
  --gold: #c9a227;
  --gold-soft: #e8c85a;
  --ink: #10233c;
  --ink-soft: #4a5d75;
  --line: #dfe6ef;
  --bg: #f4f7fb;
  --card: #ffffff;
  --ok: #1c7c54;
  --warn: #b8860b;
  --bad: #b4271f;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 34px rgba(11, 37, 69, .09);
  --shadow-lg: 0 24px 60px rgba(7, 23, 46, .22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--navy-600); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.tiny { font-size: 11.5px; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.serif { font-family: var(--serif); }

/* ------------------------------- Boot ---------------------------------- */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: linear-gradient(160deg, var(--navy-800), var(--navy-900)); color: #fff; z-index: 100;
}
.boot-mark {
  width: 62px; height: 62px; border-radius: 18px; display: grid; place-content: center;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
  font-weight: 700; letter-spacing: .5px; font-size: 20px;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .55; transform: scale(.97); } 50% { opacity: 1; transform: scale(1); } }

/* ------------------------------- Auth ---------------------------------- */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr;
  background: radial-gradient(1100px 700px at 12% 8%, #1a3d6d 0%, var(--navy-800) 42%, var(--navy-900) 100%);
  color: #fff;
}
.auth-brand { padding: 8vh 6vw; display: flex; flex-direction: column; justify-content: center; }
.auth-logo {
  width: 66px; height: 66px; border-radius: 20px; display: grid; place-content: center;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.2);
  font-weight: 700; font-size: 22px; margin-bottom: 22px;
}
.auth-brand h1 { font-size: 40px; margin: 0 0 6px; letter-spacing: -.5px; }
.auth-tag { color: var(--gold-soft); font-size: 17px; margin: 0 0 26px; font-family: var(--serif); font-style: italic; }
.auth-points { list-style: none; padding: 0; margin: 0 0 30px; max-width: 460px; }
.auth-points li { padding: 9px 0 9px 26px; position: relative; color: rgba(255,255,255,.87); font-size: 14.5px; }
.auth-points li::before { content: "—"; position: absolute; left: 0; color: var(--gold); }
.auth-owner { font-size: 12.5px; color: rgba(255,255,255,.5); margin: 0; }

.auth-card { align-self: center; justify-self: center; width: min(400px, 88vw); padding: 30px; border-radius: 22px; }
.glass {
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}
.tabs { display: flex; gap: 6px; margin-bottom: 20px; background: #eef2f8; padding: 4px; border-radius: 12px; }
.tab { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.tab.active { background: #fff; color: var(--navy-800); box-shadow: 0 2px 8px rgba(11,37,69,.1); }

/* ------------------------------- Forms --------------------------------- */
.form { display: flex; flex-direction: column; gap: 14px; }
label { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
input, select, textarea {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); width: 100%; font-weight: 400;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-500); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 120px; resize: vertical; line-height: 1.65; }
.hint { font-size: 12px; color: var(--ink-soft); margin: 2px 0 0; }
.msg { margin-top: 14px; font-size: 13.5px; }
.msg.error { color: var(--bad); }
.msg.ok { color: var(--ok); }

.btn {
  font: inherit; font-weight: 600; padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
}
.btn:hover { box-shadow: 0 4px 14px rgba(11,37,69,.12); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.btn.primary:hover { background: var(--navy-600); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #241c00; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: #f0cdcb; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ------------------------------ Layout --------------------------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--navy-800); color: #fff;
  display: grid; place-content: center; font-weight: 700; font-size: 14px; letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; letter-spacing: .3px; }
.brand-text small { font-size: 11px; color: var(--ink-soft); }

.lang-switch { display: flex; background: #eef2f8; border-radius: 9px; padding: 3px; }
.lang-switch button { border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 7px; cursor: pointer; color: var(--ink-soft); }
.lang-switch button.active { background: #fff; color: var(--navy-800); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.user-chip { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-700); color: #fff; display: grid; place-content: center; font-size: 12px; }
.icon-btn { border: 0; background: transparent; font-size: 21px; cursor: pointer; color: var(--navy-800); }
.only-mobile { display: none; }

.shell { display: grid; grid-template-columns: 232px 1fr; flex: 1; align-items: start; }
.sidebar {
  position: sticky; top: 59px; height: calc(100vh - 59px); padding: 18px 12px;
  border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; gap: 4px;
}
.sidebar a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none;
}
.sidebar a span { color: var(--navy-500); font-size: 13px; }
.sidebar a:hover { background: #f1f5fa; text-decoration: none; }
.sidebar a.active { background: var(--navy-800); color: #fff; }
.sidebar a.active span { color: var(--gold-soft); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 10px 4px 0; }

.view { padding: 26px 30px 70px; max-width: 1180px; width: 100%; }

/* ------------------------------ Elements -------------------------------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 25px; letter-spacing: -.4px; }
.page-head p { margin: 0; color: var(--ink-soft); font-size: 14px; max-width: 720px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card h3 { margin: 18px 0 8px; font-size: 15px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; background: #eef2f8; color: var(--navy-700); letter-spacing: .2px;
}
.badge.gold { background: #fbf3d8; color: #7a6100; }
.badge.ok { background: #e4f4ec; color: var(--ok); }
.badge.warn { background: #fdf3dc; color: var(--warn); }
.badge.bad { background: #fbeae9; color: var(--bad); }
.badge.navy { background: var(--navy-800); color: #fff; }

.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .k { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.6px; margin-top: 4px; }
.stat .s { font-size: 12px; color: var(--ink-soft); }

.progress { height: 7px; border-radius: 99px; background: #e8eef6; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy-600), var(--navy-500)); }

.ring { --p: 0; --c: var(--navy-600); width: 108px; height: 108px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #e8eef6 0);
  display: grid; place-content: center; position: relative; }
.ring::before { content: ""; position: absolute; inset: 11px; background: #fff; border-radius: 50%; }
.ring b { position: relative; font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.ring small { position: relative; display: block; text-align: center; font-size: 10.5px; color: var(--ink-soft); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); font-weight: 700; }
tbody tr:hover { background: #f8fafd; }
.table-wrap { overflow-x: auto; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.list li:last-child { border-bottom: 0; }
.check li { padding-left: 24px; position: relative; }
.check li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.dash li { padding-left: 18px; position: relative; }
.dash li::before { content: "—"; position: absolute; left: 0; color: var(--navy-500); }

.notice { border-left: 3px solid var(--navy-500); background: #f2f7fd; padding: 12px 14px; border-radius: 0 10px 10px 0; font-size: 13px; }
.notice.warn { border-color: var(--warn); background: #fdf7e8; }
.notice.bad { border-color: var(--bad); background: #fdf0ef; }
.notice.ok { border-color: var(--ok); background: #eff8f3; }

/* --------------------------- Project editor ----------------------------- */
.editor { display: grid; grid-template-columns: 264px 1fr; gap: 20px; align-items: start; }
.sec-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow-y: auto; }
.sec-chapter { padding: 10px 14px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-soft); font-weight: 700; background: #f7f9fc; }
.sec-item { display: flex; gap: 9px; align-items: center; padding: 9px 14px; cursor: pointer; border-bottom: 1px solid #f0f4f9; font-size: 13.5px; }
.sec-item:hover { background: #f5f8fc; }
.sec-item.active { background: var(--navy-800); color: #fff; }
.sec-item .dot { width: 8px; height: 8px; border-radius: 50%; background: #d5dde8; flex: none; }
.sec-item .dot.kurang { background: var(--warn); }
.sec-item .dot.sesuai { background: var(--ok); }
.sec-item .dot.kepanjangan { background: var(--navy-500); }
.sec-item .wc { margin-left: auto; font-size: 11px; opacity: .7; }

.editor-main { display: flex; flex-direction: column; gap: 16px; }
.editor-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#sectionText { min-height: 460px; font-family: var(--serif); font-size: 16px; line-height: 1.8; padding: 22px 24px; }
.guide-box { background: #f7f9fc; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: 13.5px; }
.guide-box ol { margin: 8px 0 0; padding-left: 20px; }
.guide-box li { margin-bottom: 6px; }
.example { background: #fffdf3; border: 1px dashed #e3d49a; border-radius: 10px; padding: 12px 14px; font-family: var(--serif); font-size: 14px; }

.accordion { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.accordion > summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary::before { content: "▸ "; color: var(--navy-500); }
.accordion[open] > summary::before { content: "▾ "; }
.accordion .inner { padding: 0 16px 16px; }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.chip.active { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

/* ------------------------------- Journals ------------------------------- */
.journal-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.journal-card h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.journal-card .meta { font-size: 12.5px; color: var(--ink-soft); }
.journal-card .links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }

/* -------------------------------- Modal --------------------------------- */
.modal { position: fixed; inset: 0; background: rgba(7,23,46,.5); display: grid; place-content: center; z-index: 90; padding: 20px; }
.modal-card { width: min(720px, 94vw); max-height: 86vh; overflow: auto; border-radius: 20px; padding: 26px; position: relative; }
.modal-close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; font-size: 24px; cursor: pointer; color: var(--ink-soft); line-height: 1; }

/* -------------------------------- Toast --------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--navy-900); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 120; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: #7a1a15; }
.toast.ok { background: #145c3e; }

.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.primary) .spin { border-color: rgba(19,49,92,.3); border-top-color: var(--navy-700); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 6vh 8vw 0; }
  .auth-card { margin: 30px auto 50px; }
  .editor { grid-template-columns: 1fr; }
  .sec-list { position: static; max-height: 320px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 59px; left: 0; width: 232px; z-index: 45; transform: translateX(-104%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .only-mobile { display: block; }
  .view { padding: 18px 16px 60px; }
  .user-chip span.name { display: none; }
}

@media print {
  .topbar, .sidebar, .editor-toolbar, .btn { display: none !important; }
  .view { padding: 0; }
  .card { border: 0; box-shadow: none; }
}
