/* ==========================================================================
   VIREKA — inner dashboard pages
   /karya-saya  (Figma "Karya Saya" 608:31608)
   /pengaturan  (Figma "Pengaturan" 714:8504)
   /detail-karya (Figma "Detail Karya" 641:31294)
   /panduan-ki  (adapted from "Tombol Jenis HAKI" 598:37724)
   All reuse the dashboard shell from dashboard.css.
   ========================================================================== */

.page { grid-column: 2 / -1; display: grid; gap: 24px; }

/* ---------------- Karya Saya ---------------- */
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filters__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 0;
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  line-height: 22px;
  color: var(--muted-2);
}
.filters__tab.is-active { color: var(--blue-600); font-weight: 700; box-shadow: 0 2px 8px rgba(16,24,64,.06); }
.filters__tab:hover { color: var(--blue-600); }
.filters__search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  min-width: 220px;
  box-shadow: 0 2px 8px rgba(16,24,64,.06);
}
.filters__search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.filters__search input {
  border: 0; background: none; width: 100%;
  font-family: var(--font-display); font-size: 14px; color: #070818;
}
.filters__search input:focus { outline: none; }

.works--grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1400px) { .works--grid4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .works--grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .works--grid4 { grid-template-columns: 1fr; } }

/* ---------------- Pengaturan ---------------- */
.settings { background: var(--white); border-radius: 26px; padding: 36px 40px; }
.settings > h1 { font-size: 32px; line-height: 43px; font-weight: 700; margin: 0 0 28px; }
.settings__section > h2 { font-size: 18px; line-height: 24px; font-weight: 700; margin: 0 0 4px; }
.settings__section > .sub { font-size: 16px; line-height: 22px; color: var(--muted); margin: 0 0 8px; }

.setting-row {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid #edeef4;
}
.setting-row:last-child { border-bottom: 0; }
.setting-row__label h3 { font-size: 16px; line-height: 22px; font-weight: 700; margin: 0 0 4px; }
.setting-row__label p { font-size: 16px; line-height: 22px; color: var(--muted); margin: 0; max-width: 302px; }

.avatar-edit { display: flex; align-items: center; gap: 20px; }
.avatar-edit img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.btn-sm {
  font-family: 'Plus Jakarta Sans', var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -.08px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  color: var(--white);
}
.btn-sm--blue { background: var(--blue-600); }
.btn-sm--blue:hover { background: #1250b8; }
.btn-sm--danger { background: #d64545; }
.btn-sm--danger:hover { background: #c03a3a; }

.setting-input {
  width: min(486px, 100%);
  border: 1px solid #dfe3ee;
  border-radius: 14px;
  background: var(--white);
  padding: 16px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #000;
}
.setting-input:focus { outline: 2px solid var(--blue-500); outline-offset: 1px; }

.toggles { display: grid; gap: 22px; }
.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.toggle-row h3 { font-size: 16px; line-height: 22px; font-weight: 500; color: #454752; margin: 0 0 4px; }
.toggle-row p { font-size: 14px; line-height: 19px; color: var(--muted); margin: 0; max-width: 490px; }
.switch { position: relative; flex: none; width: 48px; height: 28px; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.switch__track {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: #d7dbe8;
  transition: background-color .15s ease;
}
.switch__track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .15s ease;
}
.switch input:checked + .switch__track { background: var(--blue-600); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--blue-400); outline-offset: 2px; }

/* ---------------- Detail Karya ---------------- */
.detail-head {
  background: var(--white);
  border-radius: 26px;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}
.detail-head__thumb {
  width: 132px; height: 132px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2f6ee0, #5b93ff);
  display: grid;
  place-items: center;
  color: var(--white);
}
.detail-head__thumb svg { width: 48px; height: 48px; }
.detail-head h1 { font-size: 32px; line-height: 43px; font-weight: 700; margin: 0 0 6px; }
.detail-head .chip-ok { margin-bottom: 14px; }
.detail-head__label { font-size: 14px; line-height: 19px; font-weight: 500; color: var(--muted); letter-spacing: .04em; margin: 0 0 6px; }
.detail-head__pct { font-size: 56px; line-height: 1.2; font-weight: 500; color: var(--blue-600); }

.analysis {
  background: var(--white);
  border-radius: 26px;
  padding: 24px;
}
.analysis h2 { font-size: 18px; line-height: 24px; font-weight: 700; margin: 0 0 18px; }
.analysis__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.analysis__stat p { font-size: 14px; line-height: 19px; color: var(--muted); font-weight: 500; margin: 0 0 4px; }
.analysis__stat b { font-size: 32px; line-height: 43px; font-weight: 500; color: #000; }
.analysis__reco { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.analysis__reco span { font-size: 14px; font-weight: 500; }
.analysis__reco b { color: var(--blue-600); font-size: 14px; font-weight: 500; }

.detail-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-tab {
  border: 0;
  background: var(--white);
  color: var(--blue-600);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius-pill);
  padding: 11px 22px;
}
.detail-tab.is-active { background: var(--blue-600); color: var(--white); font-weight: 700; }

.djki {
  background: var(--white);
  border-radius: 26px;
  padding: 24px;
}
.djki__hint { font-size: 12px; line-height: 16px; color: var(--muted); margin: 0 0 18px; }
.djki__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; }
.field-card {
  border: 1px solid #e6e9f2;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
  position: relative;
}
.field-card h3 {
  font-size: 14px; line-height: 19px; font-weight: 500;
  color: var(--muted); letter-spacing: .04em; text-transform: uppercase;
  margin: 0 0 8px;
}
.field-card p { font-size: 14px; line-height: 19px; color: var(--ink-soft); margin: 0 0 8px; max-width: 550px; }
.field-card p:last-of-type { margin-bottom: 0; }
.field-card__copy {
  position: absolute;
  top: 12px; right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: var(--blue-600);
  color: var(--white);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 12px;
  border-radius: var(--radius-pill);
  padding: 7px 14px;
}
.field-card__copy:hover { background: #1250b8; }

@media (max-width: 1000px) {
  .setting-row { grid-template-columns: 1fr; gap: 14px; }
  .djki__grid { grid-template-columns: 1fr; }
  .detail-head { grid-template-columns: 1fr; text-align: left; }
}

/* ---------------- Panduan KI ---------------- */
.guide-intro {
  background: linear-gradient(120deg, #1450c9 0%, #2f6ee0 45%, #4f8bff 100%);
  color: var(--white);
  border-radius: 26px;
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
}
.guide-intro img {
  position: absolute;
  right: -60px; top: -80px;
  width: 380px;
  opacity: .12;
  pointer-events: none;
}
.guide-intro h1 { font-size: 32px; line-height: 43px; font-weight: 700; margin: 0 0 10px; position: relative; }
.guide-intro p { font-size: 16px; line-height: 22px; color: #dde6ff; margin: 0; max-width: 640px; position: relative; }

.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.guide-card {
  background: var(--white);
  border-radius: 22px;
  padding: 24px;
  border: 1px solid transparent;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.guide-card:hover { border-color: #ccd9f6; box-shadow: 0 12px 32px rgba(16,24,64,.08); }
.guide-card h2 { font-size: 18px; line-height: 24px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.guide-card h2 .emoji { font-size: 22px; }
.guide-card p { font-size: 14px; line-height: 21px; color: var(--ink-soft); margin: 0 0 16px; }
.guide-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-600);
  font-weight: 700;
  font-size: 14px;
}
.guide-card__cta svg { width: 14px; height: 14px; }

@media (max-width: 900px) { .guide-grid { grid-template-columns: 1fr; } }

/* ---------------- Detail Karya: tab panels ---------------- */
[data-panel][hidden] { display: none; }

.prep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.prep-head h2 { font-size: 18px; line-height: 24px; font-weight: 700; margin: 0; }
.prep-head b { color: var(--blue-600); font-size: 16px; }
.prep-head b small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }

.check-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #e6e9f2;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.check-row input { width: 18px; height: 18px; accent-color: var(--blue-600); flex: none; }
.check-row label { flex: 1; font-size: 14px; line-height: 19px; font-weight: 500; color: var(--ink-soft); }
.badge-req, .badge-opt {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
}
.badge-req { background: #fdecec; color: #d64545; }
.badge-opt { background: #eef1f7; color: var(--muted); }

.prep-side { display: grid; gap: 14px; }
.tip { display: flex; gap: 10px; font-size: 13px; line-height: 19px; color: var(--ink-soft); }
.tip::before { content: '✨'; flex: none; }
.tip b { display: block; }

.cost-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edeef4;
}
.cost-row:last-of-type { border-bottom: 0; }
.cost-row p { margin: 0; font-size: 13px; line-height: 18px; color: var(--muted); }
.cost-row b { font-size: 14px; color: var(--ink); display: block; margin-bottom: 2px; }
.cost-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #eef2fd;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 13px;
  color: var(--blue-600);
  letter-spacing: .04em;
}

.tpl-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  align-items: center;
  border: 1px solid #e6e9f2;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.tpl-row h3 { grid-column: 1; grid-row: 1; font-size: 15px; line-height: 20px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; }
.tpl-row p { grid-column: 1; grid-row: 2; font-size: 13px; line-height: 18px; color: var(--muted); margin: 0; }
.tpl-row .btn { grid-column: 2; grid-row: 1 / span 2; padding: 11px 20px; font-size: 13px; }

.guide-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.guide-steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0 16px 0;
  border-bottom: 1px solid #edeef4;
}
.guide-steps li:last-child { border-bottom: 0; }
.guide-steps .num {
  counter-increment: step;
  width: 40px; height: 40px;
  flex: none;
  border-radius: 50%;
  background: #eef2fd;
  color: var(--blue-600);
  font-weight: 700;
  display: grid;
  place-items: center;
}
.guide-steps h3 { flex: 1; font-size: 15px; line-height: 20px; font-weight: 500; margin: 0; }
.guide-steps .time {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-600);
  background: #eef2fd;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
}

/* ---------------- Generate Document (Figma 689:7579 / 689:8939) ---------------- */
.gen-loading {
  background: var(--white);
  border-radius: 26px;
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px;
}
.gen-loading .spinner {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 5px solid #e3e8f6;
  border-top-color: var(--blue-600);
  animation: spin 1s linear infinite;
  margin: 0 auto 22px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-loading h2 { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.gen-loading p { font-size: 14px; color: var(--muted); margin: 0; }

.gen-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.doc-viewer { background: var(--white); border-radius: 26px; padding: 24px; }
.doc-viewer__page {
  border: 1px solid #e6e9f2;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(16,24,64,.08);
}
.doc-viewer__page img { width: 100%; display: none; }
.doc-viewer__page img.is-current { display: block; }
.doc-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}
.doc-pager__pages { display: flex; align-items: center; gap: 6px; }
.doc-pager__pages button {
  min-width: 32px; height: 32px;
  border: 1px solid #e6e9f2;
  background: var(--white);
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--ink-soft);
}
.doc-pager__pages button.is-active { background: var(--blue-600); border-color: var(--blue-600); color: var(--white); font-weight: 700; }
.doc-pager__pages button:disabled { opacity: .4; cursor: default; }

.gen-form { background: var(--white); border-radius: 26px; padding: 24px; }
.gen-form h2 { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.gen-form > p { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.gen-form .field { display: block; margin-bottom: 14px; }
.gen-form .field span {
  display: block;
  font-size: 12px; font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.gen-form input, .gen-form textarea {
  width: 100%;
  border: 1px solid #dfe3ee;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--ink);
  resize: vertical;
}
.gen-form input:focus, .gen-form textarea:focus { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.gen-form .btn { width: 100%; margin-top: 6px; gap: 10px; }

/* ---------------- Modals & user dropdown ---------------- */
.userchip { position: relative; cursor: pointer; }
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(16,24,64,.18);
  padding: 8px;
  z-index: 60;
  display: none;
}
.user-menu.is-open { display: block; }
.user-menu button, .user-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-align: left;
}
.user-menu button:hover, .user-menu a:hover { background: #f4f6fc; }
.user-menu .danger { color: #d64545; }
.user-menu svg { width: 18px; height: 18px; flex: none; }

.modal { position: fixed; inset: 0; z-index: 80; display: none; }
.modal.is-open { display: block; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(6, 5, 11, .5); }
.modal__card {
  position: relative;
  width: min(420px, calc(100vw - 48px));
  margin: 18vh auto 0;
  background: var(--white);
  border-radius: 22px;
  padding: 32px 28px 24px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(6,5,11,.3);
}
.modal__icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}
.modal__icon--warn { background: #fdecec; color: #d64545; }
.modal__icon--info { background: #eef2fd; color: var(--blue-600); }
.modal__icon svg { width: 28px; height: 28px; }
.modal__card h2 { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.modal__card p { font-size: 14px; line-height: 20px; color: var(--muted); margin: 0 0 22px; }
.modal__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal__actions .btn { width: 100%; padding: 13px; font-size: 14px; }
.btn--danger { background: #d64545; color: var(--white); }
.btn--danger:hover { background: #c03a3a; }
.btn--muted { background: #eef1f7; color: var(--ink-soft); }
.btn--muted:hover { background: #e2e6ef; }

/* ---------------- Chat: typing/analyzing indicator ---------------- */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f2f6ff;
  border-radius: 16px;
  padding: 12px 18px;
}
.typing i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--blue-500);
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------------- Dashboard empty state ---------------- */
.empty-works {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-works svg { width: 56px; height: 56px; margin: 0 auto 14px; color: #ccd4e6; }
.empty-works h3 { font-size: 16px; font-weight: 700; color: var(--ink-soft); margin: 0 0 6px; }
.empty-works p { font-size: 13px; margin: 0 0 18px; }
