:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #1f1720;
  --muted: #6c6170;
  --line: #e5dce4;
  --primary: #e51b2a;
  --primary-dark: #7a0d14;
  --maroon: #360706;
  --accent: #e85297;
  --danger: #b42318;
  --warning: #a15c07;
  --success: #087443;
  --shadow: 0 18px 45px rgba(54, 7, 6, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(229, 27, 42, 0.06), transparent 260px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 12px clamp(18px, 4vw, 54px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  color: var(--primary-dark);
  display: flex;
  gap: 14px;
  font-weight: 800;
  min-width: 0;
}

.brand img {
  height: 48px;
  object-fit: contain;
  width: 180px;
}

.brand span {
  display: grid;
  gap: 2px;
}

.brand strong {
  color: var(--ink);
  font-size: 16px;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

nav {
  align-items: center;
  display: flex;
  gap: 16px;
}

nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 0;
}

nav a:hover {
  color: var(--primary);
}

.nav-form {
  margin: 0;
}

.nav-form button {
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 0;
}

.nav-form button:hover {
  color: var(--primary);
}

.page {
  margin: 0 auto;
  max-width: 1180px;
  padding: 28px clamp(16px, 4vw, 40px) 56px;
}

.hero {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(54, 7, 6, 0.96), rgba(122, 13, 20, 0.94) 54%, rgba(232, 82, 151, 0.9)),
    #360706;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: white;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 300px;
  overflow: hidden;
  padding: clamp(28px, 5vw, 54px);
}

.hero h1,
.status-head h1,
.section-title h1 {
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.02;
  margin: 8px 0 14px;
  max-width: 820px;
}

.lead {
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.6;
  max-width: 720px;
}

.lead.dark {
  color: var(--muted);
  font-weight: 800;
  margin: 0;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffc4d7;
}

.hero-copy {
  min-width: 0;
}

.hero-mark {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  color: var(--maroon);
  display: grid;
  flex: 0 1 360px;
  gap: 12px;
  padding: 18px;
}

.hero-mark img {
  max-width: 100%;
  object-fit: contain;
}

.hero-mark span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.panel,
.dashboard-hero,
.metric,
.status-check,
.auth-card,
.tracking-hero,
.timeline-step,
.history-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  margin-top: 24px;
  padding: clamp(20px, 4vw, 34px);
}

.panel h2 {
  margin: 0 0 22px;
}

.panel-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.panel-heading h2 {
  margin: 6px 0 0;
}

.soft-chip {
  background: #fff0f5;
  border: 1px solid #ffd4e2;
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  padding: 8px 12px;
}

.status-check {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-top: 18px;
  padding: clamp(18px, 3vw, 24px);
}

.status-check h2 {
  margin: 6px 0 0;
}

.status-check form {
  display: flex;
  flex: 0 1 430px;
  gap: 10px;
}

.status-check input {
  min-width: 0;
}

.status-check .primary,
.status-check .secondary {
  white-space: nowrap;
}

.tracking-hero {
  align-items: center;
  border-left: 6px solid var(--primary);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: clamp(22px, 4vw, 34px);
}

.tracking-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.03;
  margin: 8px 0 12px;
}

.timeline-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.timeline-step {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.timeline-step span {
  align-items: center;
  background: #f0eef2;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.timeline-step.done span {
  background: var(--primary);
  color: white;
}

.timeline-step strong {
  color: var(--ink);
}

.timeline-step small {
  color: var(--muted);
  font-weight: 700;
}

.history-search {
  margin-top: 18px;
}

.history-list {
  display: grid;
  gap: 14px;
}

.history-card {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(220px, 1.3fr) minmax(280px, 1.7fr) auto;
  padding: 18px;
}

.history-main h3 {
  margin: 12px 0 6px;
}

.history-main p {
  color: var(--muted);
  margin: 0;
}

.history-meta {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.history-meta div {
  background: #fffafa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 160px);
  place-items: center;
}

.auth-card {
  max-width: 460px;
  padding: clamp(24px, 5vw, 36px);
  width: 100%;
}

.auth-card img {
  display: block;
  margin-bottom: 22px;
  max-width: 260px;
  width: 100%;
}

.auth-card h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.05;
  margin: 8px 0 12px;
}

.auth-card p {
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.form-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  color: var(--muted);
  display: grid;
  font-size: 14px;
  font-weight: 800;
  gap: 8px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 12px 14px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(229, 27, 42, 0.1);
  outline: none;
}

textarea {
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.file-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

button,
.primary,
.secondary,
.danger {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 900;
  justify-content: center;
  padding: 12px 16px;
}

.primary {
  background: var(--primary);
  color: white;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  background: #f0eef2;
  color: #312533;
}

.danger {
  background: #fee4e2;
  color: var(--danger);
}

.small {
  font-size: 13px;
  padding: 9px 12px;
}

.flash-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  border-radius: 8px;
  font-weight: 800;
  padding: 12px 14px;
}

.flash.success {
  background: #dcfae6;
  color: var(--success);
}

.flash.error {
  background: #fee4e2;
  color: var(--danger);
}

.status-head,
.section-title,
.actions {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.dashboard-hero {
  border-left: 6px solid var(--primary);
  padding: clamp(22px, 4vw, 34px);
}

.metric-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.metric {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric strong {
  color: var(--primary-dark);
  font-size: 34px;
  line-height: 1;
}

.detail-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 28px 0;
}

.detail-grid div {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.detail-grid .wide {
  grid-column: 1 / -1;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
  text-transform: uppercase;
}

dd {
  margin: 0;
}

.hash,
.hash-cell {
  font-family: "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  padding: 7px 11px;
  white-space: nowrap;
}

.badge.menunggu {
  background: #fef0c7;
  color: var(--warning);
}

.badge.ditandatangani {
  background: #dcfae6;
  color: var(--success);
}

.badge.ditolak {
  background: #fee4e2;
  color: var(--danger);
}

.counter {
  background: #fff0f5;
  border: 1px solid #ffd4e2;
  border-radius: 999px;
  color: var(--primary-dark);
  font-weight: 900;
  padding: 9px 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 940px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 15px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fffafa;
}

td span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

.hash-cell {
  max-width: 260px;
}

.action-cell {
  min-width: 320px;
}

.action-cell,
.action-cell form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-cell input {
  max-width: 190px;
  padding: 9px 10px;
}

.empty {
  color: var(--muted);
  padding: 34px;
  text-align: center;
}

@media (max-width: 720px) {
  .topbar,
  .status-head,
  .section-title,
  .actions,
  .panel-heading,
  .status-check,
  .tracking-hero {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    flex-wrap: wrap;
  }

  .brand {
    align-items: flex-start;
  }

  .brand img {
    height: 40px;
    width: 146px;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .status-check form {
    flex-direction: column;
  }

  .history-card {
    grid-template-columns: 1fr;
  }

  .history-actions {
    justify-content: flex-start;
  }

  .form-grid,
  .detail-grid,
  .metric-grid,
  .timeline-grid,
  .history-meta {
    grid-template-columns: 1fr;
  }
}

/* =========================
   FORM TTD KAPRODI
========================= */

.sign-form{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin-top:8px;
}

.sign-form input{
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  color:var(--ink);
  font-size:13px;
  height:38px;
  padding:0 12px;
}

.sign-form input[name="nomor_surat"]{
  width:180px;
}

.sign-form input[name="kaprodi_name"]{
  width:220px;
}

.sign-form input[name="pin"]{
  width:90px;
}

.sign-form button{
  align-items:center;
  display:flex;
  height:38px;
  justify-content:center;
  padding:0 16px;
}

.action-cell{
  min-width:560px;
}

.action-cell form{
  margin:0;
}

/* =========================
   RESPONSIVE MOBILE
========================= */

@media (max-width: 768px){

  .sign-form{
    flex-direction:column;
    align-items:stretch;
  }

  .sign-form input,
  .sign-form button{
    width:100% !important;
  }

  .action-cell{
    min-width:320px;
  }

}
.tracking-code-box {
    margin-top: 14px;
    background: #e7f7ed;
    color: #0f5132;
    border: 1px solid #badbcc;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 700;
    display: inline-block;
}

/* =========================================================
   HALAMAN VERIFIKASI (TUJUAN QR CODE PADA SURAT)
   ========================================================= */

.badge.sah,
.badge.disetujui {
  background: #dcfae6;
  color: var(--success);
}

.verify-hero {
  border-left: 6px solid var(--success);
}

.verify-panel {
  margin-top: 18px;
}

.specimen {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 0;
  padding: 18px 20px;
}

.specimen img {
  background: #ffffff;
  border: 1px dashed var(--line);
  border-radius: 12px;
  max-height: 130px;
  max-width: 260px;
  object-fit: contain;
  padding: 6px;
}

.specimen figcaption {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.specimen figcaption strong {
  font-size: 17px;
}

.specimen figcaption span {
  color: var(--muted);
  font-size: 14px;
}

.specimen figcaption small {
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

.specimen-note {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 14px 0 0;
}

@media (max-width: 640px) {
  .specimen {
    justify-content: center;
    text-align: center;
  }

  .specimen figcaption {
    align-items: center;
  }
}

/* =========================
   PEMOHON KELOMPOK (SURAT B)
========================= */

[hidden] {
  display: none !important;
}

.grup-anggota {
  background: rgba(229, 27, 42, 0.03);
  border: 1px dashed var(--line);
  border-radius: 12px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.grup-heading {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.grup-heading h3 {
  font-size: 18px;
  margin: 4px 0 0;
}

.grup-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  margin: 8px 0 0;
  max-width: 62ch;
}

.anggota-list {
  display: grid;
  gap: 12px;
}

.anggota-list:empty {
  display: none;
}

.anggota-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.anggota-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.anggota-nomor {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.anggota-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 0.8fr);
}

#tambah-anggota {
  justify-self: start;
}

.field-hint {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.6;
}

.anggota-tabel {
  border-collapse: collapse;
  margin-top: 10px;
  width: 100%;
}

.anggota-tabel th,
.anggota-tabel td {
  border: 1px solid var(--line);
  font-size: 13.5px;
  padding: 8px 10px;
  text-align: left;
}

.anggota-tabel th {
  background: rgba(229, 27, 42, 0.05);
  font-weight: 800;
}

@media (max-width: 720px) {
  .anggota-fields {
    grid-template-columns: 1fr;
  }
}

.anggota-judul {
  font-size: 16px;
  margin: 22px 0 0;
}
