/* ==========================================================================
   Sistem Manajemen & Validasi Dokumen Resmi - CSS3 Murni (Tanpa Framework)
   Font: Montserrat & Plus Jakarta Sans + Google Material Symbols Outlined
   ========================================================================== */

:root {
  --bg-canvas: #f5f7fa;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #f8fafc;
  --border-hairline: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent-primary: #0f3d6e;
  --accent-primary-hover: #0a2d52;
  --accent-gold: #b48327;
  --status-success-bg: #ecfdf5;
  --status-success-text: #065f46;
  --status-error-bg: #fef2f2;
  --status-error-text: #991b1b;
  --status-warning-bg: #fffbeb;
  --status-warning-text: #92400e;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --sidebar-width: 264px;
  --sidebar-collapsed: 76px;
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Montserrat', 'Plus Jakarta Sans', sans-serif;
  margin: 0;
  line-height: 1.25;
  color: var(--text-primary);
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  user-select: none;
  font-size: 20px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   Admin Shell & Collapsible Sidebar
   ========================================================================== */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width var(--transition), transform var(--transition);
  z-index: 40;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-shell.is-collapsed .admin-sidebar {
  width: var(--sidebar-collapsed);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 68px;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.sidebar-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-brand-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  white-space: nowrap;
}

.admin-shell.is-collapsed .sidebar-brand-title,
.admin-shell.is-collapsed .sidebar-label,
.admin-shell.is-collapsed .sidebar-section-heading {
  display: none;
}

.sidebar-collapse-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--transition), color var(--transition);
}

.sidebar-collapse-btn:hover {
  background-color: var(--bg-sidebar-hover);
  color: #ffffff;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-section-heading {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  padding: 12px 12px 6px;
  letter-spacing: 0.04em;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  min-height: 42px;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background-color var(--transition), color var(--transition);
}

.sidebar-link:hover {
  background-color: var(--bg-sidebar-hover);
  color: #ffffff;
}

.sidebar-link.is-active {
  background-color: var(--accent-primary);
  color: #ffffff;
  font-weight: 600;
}

.sidebar-link-danger:hover {
  background-color: rgba(220, 38, 38, 0.18);
  color: #fecaca;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.admin-content {
  padding: 24px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   Cards, Alerts, Forms, Buttons
   ========================================================================== */
.panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.panel + .panel {
  margin-top: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-hairline);
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
}

.panel-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert-success {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: #a7f3d0;
}

.alert-error {
  background-color: var(--status-error-bg);
  color: var(--status-error-text);
  border-color: #fecaca;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.is-full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(15, 61, 110, 0.12);
}

.form-control[readonly] {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
}

textarea.form-control {
  min-height: 88px;
  resize: vertical;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
}

.btn-danger {
  background-color: #dc2626;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-icon {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

/* ==========================================================================
   Toolbar Filter & Data Table
   ========================================================================== */
.filter-bar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 12px;
  margin-bottom: 18px;
  align-items: end;
}

.filter-bar-docs {
  grid-template-columns: 2fr 1.2fr 1.2fr auto;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.data-table th {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-hairline);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: top;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Searchable Select Dropdown */
.searchable-select {
  position: relative;
}

.searchable-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
  z-index: 30;
  display: none;
}

.searchable-dropdown.is-open {
  display: block;
}

.searchable-option {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.searchable-option:hover {
  background-color: var(--bg-subtle);
}

.searchable-option-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
}

.searchable-option-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   Modal Dialogs
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-hairline);
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border-hairline);
}

.detail-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
  font-size: 14px;
}

.detail-term {
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   Auth Login Page & Public Verification Portal
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.verify-page {
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  display: flex;
  flex-direction: column;
}

.verify-scrim {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 52% 58% at 4% 16%, rgba(254, 240, 199, 0.82) 0%, rgba(254, 249, 227, 0.45) 45%, transparent 78%),
    linear-gradient(125deg, rgba(255, 252, 242, 0.56) 0%, rgba(248, 250, 252, 0.64) 48%, rgba(235, 241, 250, 0.78) 100%);
  display: flex;
  flex-direction: column;
}

.verify-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 36px;
  width: 100%;
}

.verify-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.verify-brand img {
  height: 42px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.verify-lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 999px;
  padding: 6px 14px;
  color: #0f172a;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.08);
}

.verify-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.verify-card {
  width: 100%;
  max-width: 396px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.verify-card-title {
  font-size: 24px;
  font-weight: 800;
  color: #0e1e54;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.verify-card-subtitle {
  margin: 0 0 20px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}

.input-with-icon {
  position: relative;
}

.input-leading-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #0e1e54;
  font-size: 17px;
  pointer-events: none;
}

.input-with-icon .form-control {
  padding-left: 38px;
  min-height: 42px;
  font-size: 13px;
  border-color: #e2e8f0;
  border-radius: 8px;
}

.robot-check-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 218px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #0e1e54;
}

.btn-navy {
  background-color: #0d1e56;
  color: #ffffff;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(13, 30, 86, 0.18);
}

.btn-navy:hover {
  background-color: #091642;
}

.verify-footer {
  padding: 16px 36px;
  font-size: 12px;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   A4 Print Document Sheet (Surat Keterangan Dokumen)
   ========================================================================== */
.a4-toolbar {
  max-width: 210mm;
  margin: 20px auto 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px;
}

.a4-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 32px;
  background: #ffffff;
  padding: 10mm 14mm 15mm 21mm;
  box-shadow: var(--shadow-md);
  color: #000000;
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: Arial, Helvetica, sans-serif;
}

.a4-kop {
  display: flex;
  align-items: center;
  gap: 9pt;
  padding-bottom: 7pt;
  border-bottom: 1.8pt solid #000000;
}

.a4-kop-logo {
  width: 48pt;
  height: 48pt;
  margin-left: 10pt;
  object-fit: contain;
  flex-shrink: 0;
}

.a4-kop-text {
  flex: 1;
  text-align: center;
  line-height: 1.2;
}

.a4-kop-instansi {
  font-size: 13pt;
  font-weight: 700;
  text-transform: uppercase;
}

.a4-kop-subinstansi {
  font-size: 12pt;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 1pt;
}

.a4-kop-prov,
.a4-kop-kanwil {
  font-size: 12pt;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 1pt;
}

.a4-kop-meta {
  font-size: 7pt;
  color: #000000;
  margin-top: 1.5pt;
  line-height: 1.25;
}

.a4-title-wrap {
  text-align: center;
  margin: 17pt 0 22pt;
}

.a4-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11pt;
  font-weight: 700;
  margin: 0;
  color: #000000;
}

.a4-doc-number {
  font-size: 11pt;
  margin-top: 3pt;
}

.a4-doc-date {
  font-size: 11pt;
  margin-top: 2pt;
}

.a4-body {
  font-size: 11pt;
  line-height: 1.45;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.a4-data-table {
  width: 100%;
  border-collapse: collapse;
}

.a4-data-table td {
  padding: 2pt 0;
  vertical-align: top;
  font-size: 10pt;
}

.a4-data-table td:first-child {
  width: 77pt;
}

.a4-data-table td:nth-child(2) {
  width: 9pt;
  text-align: left;
}

.a4-indent {
  text-indent: 28pt;
  margin-top: 10pt;
}

.a4-justify {
  text-align: justify;
}

.a4-bottom-group {
  margin-top: auto;
  padding-top: 28pt;
}

.a4-barcode-wrap {
  margin-left: 284pt;
}

.a4-barcode {
  width: 48pt;
  height: 48pt;
  object-fit: contain;
  background: #ffffff;
}

.a4-keterangan {
  margin-top: 52pt;
  font-size: 9pt;
  line-height: 1.4;
}

.a4-electronic-footer {
  margin-top: 91pt;
  font-size: 6.8pt;
  line-height: 1.35;
  color: #000000;
}

.a4-electronic-line {
  width: 141pt;
  border-top: 0.7pt solid #000000;
  margin-bottom: 4pt;
}

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  body {
    background: #ffffff;
  }
  .no-print {
    display: none !important;
  }
  .a4-sheet {
    box-shadow: none;
    margin: 0;
    width: 210mm;
    min-height: 297mm;
  }
}

/* ==========================================================================
   Responsive Mobile Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .filter-bar,
  .filter-bar-docs {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  .admin-shell.is-mobile-open .admin-sidebar {
    transform: translateX(0);
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .admin-content {
    padding: 16px;
  }
  .a4-sheet {
    width: 100%;
    min-height: auto;
    padding: 20px;
  }
}
