/* GercepTA - tampilan dasbor administratif, mode terang. Bootstrap 5.3 + Font Awesome, dibundel lokal. */

@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

:root {
  --gt-indigo-950: #171f47;
  --gt-indigo-900: #1d2857;
  --gt-indigo-700: #2c3b80;
  --gt-primary: #3557d6;
  --gt-amber: #f2b632;
  --gt-surface: #f3f5fb;
  --gt-border: #dfe4f1;
  --gt-sidebar-w: 264px;

  --bs-primary: #3557d6;
  --bs-primary-rgb: 53, 87, 214;
  --bs-link-color: #2b47b8;
  --bs-link-color-rgb: 43, 71, 184;
  --bs-link-hover-color: #1f3390;
  --bs-body-font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-size: 1rem;
  --bs-body-bg: var(--gt-surface);
  --bs-border-color: var(--gt-border);
  --bs-border-radius: .6rem;
}

body { background: var(--gt-surface); }
.btn-primary { --bs-btn-bg: #3557d6; --bs-btn-border-color: #3557d6; --bs-btn-hover-bg: #2b47b8; --bs-btn-hover-border-color: #2b47b8;
  --bs-btn-active-bg: #243c9c; --bs-btn-active-border-color: #243c9c; }
.btn, .form-control, .form-select, .input-group-text { min-height: 2.75rem; }   /* nyaman disentuh */
.btn-sm { min-height: 2.5rem; }   /* 40 px: batas ukuran sentuh yang diukur uji Chromium */
.tautan-sentuh { display: inline-flex; align-items: center; min-height: 2.75rem; }
.form-control, .form-select, .input-group-text { background-color: #fff; }
.input-group-text { background-color: #f8f9fd; color: #4a5378; }
:focus-visible { outline: 3px solid rgba(53, 87, 214, .45); outline-offset: 2px; }

/* ---- kerangka ---- */
.app-shell { min-height: 100vh; }
.app-sidebar { --bs-offcanvas-width: 280px; --bs-offcanvas-bg: var(--gt-indigo-900); --bs-offcanvas-color: #fff;
  background: var(--gt-indigo-900); color: #fff; }
.app-sidebar .offcanvas-header { padding: .75rem 1rem 0; }
.app-main { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }

@media (min-width: 992px) {
  .app-sidebar.offcanvas-lg { position: fixed !important; top: 0; bottom: 0; left: 0; z-index: 1030;
    width: var(--gt-sidebar-w) !important; height: 100vh !important; background: var(--gt-indigo-900) !important; overflow-y: auto;
    display: flex; flex-direction: column; }
  .app-sidebar.offcanvas-lg .offcanvas-body { flex-grow: 1 !important; }
  .app-main { margin-left: var(--gt-sidebar-w); }
}

.brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1.5rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 2.5rem; height: 2.5rem; border-radius: .7rem; background: var(--gt-amber); color: var(--gt-indigo-950); font-size: 1.15rem; }
.brand-mark-lg { width: 3.5rem; height: 3.5rem; font-size: 1.6rem; border-radius: 1rem; }
.brand-name { display: block; font-weight: 700; font-size: 1.25rem; line-height: 1.1; }
.brand-sub { display: block; font-size: .78rem; line-height: 1.25; color: rgba(255,255,255,.65); margin-top: .15rem; }

.side-nav { padding: 0 .75rem; gap: .2rem; }
.side-nav .nav-link { display: flex; align-items: center; gap: .75rem; min-height: 2.75rem; padding: .55rem .85rem;
  color: rgba(255,255,255,.78); border-radius: .6rem; border-left: 3px solid transparent; transition: background-color .15s; }
.side-nav .nav-link:hover { background: var(--gt-indigo-700); color: #fff; }
.side-nav .nav-link.active { background: var(--gt-indigo-700); color: #fff; font-weight: 600; border-left-color: var(--gt-amber); }
.side-foot { padding: 1rem 1.25rem; font-size: .8rem; color: rgba(255,255,255,.55); border-top: 1px solid rgba(255,255,255,.1); }

.app-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem;
  min-height: 3.75rem; padding: .5rem 1rem; background: #fff; border-bottom: 1px solid var(--gt-border); }
.btn-icon { width: 2.75rem; padding: 0; border: 1px solid var(--gt-border); background: #fff; color: var(--gt-indigo-900); }
.user-chip { display: flex; align-items: center; gap: .65rem; padding: .3rem .5rem; background: transparent; border: 0; border-radius: .7rem; color: inherit; min-height: 2.75rem; }
.user-chip:hover { background: var(--gt-surface); }
.user-name { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--gt-primary); color: #fff; font-weight: 700; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: 1.25rem 1rem .25rem; }
.page-title { font-size: 1.6rem; font-weight: 700; color: var(--gt-indigo-900); margin: 0; }
.breadcrumb { font-size: .92rem; }
.app-content { flex: 1 0 auto; padding: 1rem; }
.app-foot { padding: 1rem; font-size: .85rem; color: #6b7391; }
@media (min-width: 768px) { .page-head { padding: 1.5rem 1.5rem .25rem; } .app-content { padding: 1rem 1.5rem 1.5rem; } .app-topbar { padding: .5rem 1.5rem; } }

/* ---- komponen ---- */
.card { border: 1px solid var(--gt-border); border-radius: .8rem; box-shadow: 0 1px 2px rgba(23, 31, 71, .05); }
.card-header { background: #fff; font-weight: 600; color: var(--gt-indigo-900); border-bottom: 1px solid var(--gt-border);
  border-radius: .8rem .8rem 0 0 !important; padding: .85rem 1.1rem; }
.card-body { padding: 1.1rem; }
.table > :not(caption) > * > * { padding: .8rem 1rem; }
.table thead th { font-weight: 600; color: #4a5378; background: #f8f9fd; border-bottom: 1px solid var(--gt-border); white-space: nowrap; }
.data-list dt { font-weight: 600; color: #4a5378; }
.data-list dd { margin-bottom: .75rem; overflow-wrap: anywhere; }
.form-label { font-weight: 600; color: #333a5c; }

.stat-card { display: flex; align-items: center; gap: 1rem; height: 100%; padding: 1.1rem; background: #fff;
  border: 1px solid var(--gt-border); border-radius: .8rem; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 3rem; height: 3rem; border-radius: .8rem; font-size: 1.3rem; }
.stat-primary .stat-icon { background: #e3e9ff; color: #2a3f9e; }
.stat-warning .stat-icon { background: #fff0d1; color: #8a5a00; }
.stat-info .stat-icon { background: #d9f1fb; color: #0c5f80; }
.stat-violet .stat-icon { background: #ece3ff; color: #5a34b0; }
.stat-success .stat-icon { background: #d8f3e6; color: #14653f; }
.stat-link { text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.stat-link:hover { border-color: #b9c4ee; box-shadow: 0 2px 8px rgba(23, 31, 71, .1); color: inherit; }
.stat-num { font-size: 1.9rem; font-weight: 700; line-height: 1; color: var(--gt-indigo-900); }
.stat-label { color: #5a6284; font-size: .92rem; }

.status-badge { display: inline-flex; align-items: flex-start; gap: .4rem; font-weight: 600; font-size: .85rem; padding: .4em .75em; border-radius: 1rem; white-space: normal; text-align: left; line-height: 1.3; }
.status-badge > i { flex: none; margin-top: .12em; }
.st-diajukan  { background: #e3e9ff; color: #2a3f9e; }
.st-perbaikan { background: #fff0d1; color: #7a4f00; }
.st-kembali   { background: #d9f1fb; color: #0c5f80; }
.st-surat     { background: #ece3ff; color: #5a34b0; }
.st-diterima  { background: #d8f3e6; color: #14653f; }
.st-ditolak   { background: #fde0e4; color: #9b1c33; }
.st-verifikasi{ background: #d6f0ee; color: #0b5f5a; }
.st-pbp-tentu { background: #e3e9ff; color: #2a3f9e; }
.st-pbp-surat { background: #ece3ff; color: #5a34b0; }
.st-pbp-unggah{ background: #d9f1fb; color: #0c5f80; }
.st-pbp-lengkap{ background: #d8f3e6; color: #14653f; }
.st-netral    { background: #e9ecf4; color: #3d4566; }

.error-code { font-size: 2.6rem; font-weight: 700; color: var(--gt-primary); letter-spacing: .02em; }

/* ---- halaman masuk ---- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: linear-gradient(160deg, #e6ebfb 0%, #f3f5fb 55%, #fdf3da 100%); }
.login-wrap { display: flex; width: 100%; max-width: 900px; overflow: hidden; background: #fff; border-radius: 1.1rem;
  border: 1px solid var(--gt-border); box-shadow: 0 10px 30px rgba(23, 31, 71, .12); }
.login-brand { flex: 0 0 42%; flex-direction: column; justify-content: center; gap: 1rem; padding: 2.5rem; color: #fff; background: var(--gt-indigo-900); }
.login-brand h1 { font-size: 2rem; font-weight: 700; margin: .5rem 0 0; }
.login-brand p { margin: 0; color: rgba(255,255,255,.85); }
.login-form { flex: 1 1 auto; padding: 2rem 1.5rem; min-width: 0; }
@media (min-width: 768px) { .login-form { padding: 2.5rem; } }
.plain-page { background: var(--gt-surface); }

/* ---- sidebar: kelompok menu ---- */
.side-group { padding: 1rem .95rem .35rem; font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.55); }
.side-nav > .side-group:first-child { padding-top: 0; }
.side-nav .nav-link { display: flex; }

/* ---- filter status (tab pill yang dapat digulir) ---- */
.tab-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .25rem; }
.status-pills { gap: .4rem; }
.status-pills .nav-link { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; white-space: nowrap;
  color: #333a5c; background: #fff; border: 1px solid var(--gt-border); border-radius: 2rem; padding: .4rem .9rem; }
.status-pills .nav-link:hover { background: #eef1fb; }
.status-pills .nav-link.active { background: var(--gt-primary); border-color: var(--gt-primary); color: #fff; }
.pill-count { background: #e9ecf4; color: #333a5c; font-weight: 600; }
.status-pills .active .pill-count { background: rgba(255,255,255,.22); color: #fff; }
.pill-alert { background: #fde0e4; color: #8a1a2f; }
.status-pills .active .pill-alert { background: #fff; color: #8a1a2f; }

/* ---- paginasi ---- */
.pagination-touch .page-link { min-height: 2.75rem; display: inline-flex; align-items: center; padding: .4rem .9rem; color: var(--gt-primary); }
.card-footer { background: #fff; border-top: 1px solid var(--gt-border); border-radius: 0 0 .8rem .8rem !important; }

/* ---- area sentuh tautan sebaris (>= 40 px) tanpa menambah tinggi baris ---- */
.table td > a:not(.btn), .table td > div > a:not(.btn) { display: inline-block; padding-block: .6rem; margin-block: -.6rem; }
.card-footer > a { display: inline-block; padding-block: .6rem; margin-block: -.6rem; }
.breadcrumb-item > a { display: inline-block; padding-block: .6rem; margin-block: -.6rem; }

/* kartu statistik lebih ringkas di layar sempit (dua kolom) */
@media (max-width: 575.98px) {
  .stat-card { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .85rem; }
  .stat-num { font-size: 1.5rem; }
}
.timeline-sep { margin-inline: .15rem; }

/* ---- keadaan kosong ---- */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: #5a6284; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; margin-bottom: .75rem;
  border-radius: 50%; background: #eef1fb; color: #4a5a9e; font-size: 1.4rem; }

/* ---- timeline vertikal ---- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 1.15rem; top: .5rem; bottom: .5rem; width: 2px; background: var(--gt-border); }
.timeline-item { position: relative; display: flex; gap: .9rem; padding-bottom: 1.4rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker { position: relative; z-index: 1; flex: 0 0 2.3rem; width: 2.3rem; height: 2.3rem; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 3px solid #fff; font-size: .9rem; }
.timeline-item.is-current .timeline-marker { box-shadow: 0 0 0 2px var(--gt-primary); }
.timeline-body { min-width: 0; padding-top: .15rem; }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.timeline-title { font-weight: 700; color: var(--gt-indigo-900); }
.timeline-now { font-weight: 600; color: var(--gt-primary); }
.timeline-meta { font-size: .9rem; color: #5a6284; }
.timeline-note { margin: .5rem 0 0; padding: .55rem .75rem; background: #f8f9fd; border-left: 3px solid var(--gt-border); border-radius: .4rem; font-size: .95rem; overflow-wrap: anywhere; }

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

/* Pilihan radio berukuran sentuh: seluruh baris (label) adalah area ketuk, tinggi minimal 44 px. */
.pilihan { margin-bottom: .5rem; }
.pilihan label { display: flex; align-items: center; gap: .75rem; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--bs-border-color); border-radius: .5rem; cursor: pointer; }
.pilihan input[type="radio"] { flex: none; width: 1.25rem; height: 1.25rem; margin: 0; }
.pilihan label:has(input:checked) { border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.pilihan label:has(input:focus-visible) { outline: 3px solid var(--bs-primary-border-subtle); outline-offset: 1px; }

/* Layout polos (login, galat tanpa sesi). Sebelumnya atribut style sebaris; dipindah agar CSP tidak perlu 'unsafe-inline'. */
.lebar-polos { max-width: 640px; }
