/* Tema Utama BPJS Ketenagakerjaan */

:root {
  --bpjs-green: #007A3D;
  --bpjs-green-hover: #00964B;
  --bpjs-green-dark: #005F30;
  --bpjs-green-soft: #E8F5E9;
  --bpjs-green-border: #C8E6C9;
  
  --bpjs-dark: #212529;
  --bpjs-muted: #495057;
  --bpjs-border: #CED4DA;
  --bpjs-bg: #F4F6F5;
  --bpjs-card-bg: #FFFFFF;
  
  --radius: 4px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, 'Segoe UI', Tahoma, sans-serif;
  background-color: var(--bpjs-bg);
  color: var(--bpjs-dark);
  font-size: 13px;
  line-height: 1.45;
  padding-bottom: 75px;
}

/* Header Utama */
.app-header {
  background-color: #FFFFFF;
  border-bottom: 2px solid var(--bpjs-green);
  padding: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.header-container {
  max-width: 1050px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

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

.header-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background-color: var(--bpjs-border);
}

.brand-text h1 {
  font-size: 14px;
  font-weight: bold;
  color: var(--bpjs-green);
  line-height: 1.2;
}

.brand-text p {
  font-size: 11px;
  color: var(--bpjs-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Master Bar */
.master-bar {
  background-color: var(--bpjs-green-soft);
  border-bottom: 1px solid var(--bpjs-green-border);
  padding: 5px 16px;
  font-size: 11px;
}

.master-container {
  max-width: 1050px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.master-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--bpjs-green-dark);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.active {
  background-color: var(--bpjs-green);
}

/* Tombol */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
  font-family: inherit;
}

#btn-new-study, .btn-primary {
  background-color: #007A3D !important;
  color: #FFFFFF !important;
  border-color: #006331 !important;
}

#btn-new-study:hover, .btn-primary:hover {
  background-color: #00964B !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 10px rgba(0, 150, 75, 0.5) !important;
}

.btn-secondary {
  background-color: #495057;
  color: #FFFFFF;
}
.btn-secondary:hover {
  background-color: #343A40;
}

.btn-outline {
  background-color: #FFFFFF;
  border-color: var(--bpjs-border);
  color: var(--bpjs-dark);
}
.btn-outline:hover {
  background-color: #E9ECEF;
  border-color: #ADB5BD;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--bpjs-green-dark);
  font-weight: bold;
  cursor: pointer;
  padding: 0;
}

.btn-icon {
  background: none;
  border: none;
  color: #DC3545;
  cursor: pointer;
  font-size: 13px;
  padding: 3px;
}

/* Tab Navigasi */
.section-tabs {
  max-width: 1050px;
  margin: 8px auto;
  display: flex;
  background: #FFFFFF;
  border-radius: var(--radius);
  padding: 3px;
  border: 1px solid var(--bpjs-border);
  gap: 3px;
}

.tab-item {
  flex: 1;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border: none;
  background: none;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--bpjs-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s;
}

.tab-num {
  background-color: #E9ECEF;
  color: var(--bpjs-dark);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
}

.tab-item.active {
  background-color: var(--bpjs-green);
  color: #FFFFFF;
}

.tab-item.active .tab-num {
  background-color: #FFFFFF;
  color: var(--bpjs-green);
}

/* Form Container */
.main-container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 10px;
}

.form-card {
  display: none;
  background: var(--bpjs-card-bg);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 15px;
  border: 1px solid var(--bpjs-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  min-height: calc(100vh - 195px);
  box-sizing: border-box;
}

.form-card.active {
  display: block;
}

.card-header {
  margin-bottom: 14px;
  border-bottom: 2px solid var(--bpjs-green-soft);
  padding-bottom: 8px;
}

.badge-tag {
  display: inline-block;
  background-color: var(--bpjs-green-soft);
  color: var(--bpjs-green-dark);
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 2px;
  margin-bottom: 4px;
}

.card-header h2 {
  font-size: 16px;
  color: var(--bpjs-dark);
  font-weight: bold;
}

.card-header .subtitle {
  font-size: 11px;
  color: var(--bpjs-muted);
}

.subsection-title {
  font-size: 13px;
  color: var(--bpjs-dark);
  margin: 16px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid #E9ECEF;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: bold;
}

.sticky-hint {
  font-size: 11px;
  font-weight: normal;
  color: var(--bpjs-green);
}

/* Grid & Input */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
}

.col-12 { grid-column: span 12; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }

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

.form-group label {
  font-size: 11.5px;
  font-weight: 600;
  color: #333333;
}

.req { 
  color: #DC3545; 
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid var(--bpjs-border);
  border-radius: var(--radius);
  background-color: #FFFFFF;
  color: var(--bpjs-dark);
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--bpjs-green);
  box-shadow: 0 0 0 2px rgba(0, 122, 61, 0.15);
}

input[readonly] {
  background-color: #F8F9FA;
  color: #495057;
  font-weight: bold;
}

.inner-box {
  background-color: #F8F9FA;
  border: 1px solid var(--bpjs-border);
  border-radius: var(--radius);
  padding: 10px;
}

.inner-box strong {
  display: block;
  font-size: 12px;
  color: var(--bpjs-green-dark);
  margin-bottom: 6px;
}

.legal-notice {
  background-color: #F8F9FA;
  border-left: 3px solid var(--bpjs-green);
  padding: 10px 14px;
  font-size: 11.5px;
  margin-bottom: 14px;
}

.legal-notice ol {
  padding-left: 18px;
  margin: 4px 0 8px 0;
}

.radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #FFFFFF;
  border: 1px solid var(--bpjs-border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
}

.radio-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-block {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--bpjs-border);
  border-radius: var(--radius);
  cursor: pointer;
  background: #FFFFFF;
}

.radio-block span {
  display: block;
  font-size: 11px;
  color: var(--bpjs-muted);
}

.inline-input {
  width: 55px !important;
  display: inline-block !important;
  padding: 2px 4px !important;
  height: 24px;
  margin: 0 4px;
}

/* Tabel */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.data-table th, .data-table td {
  border: 1px solid var(--bpjs-border);
  padding: 6px 8px;
}

.data-table th {
  background-color: #F1F3F5;
  color: #212529;
  font-weight: bold;
  text-align: left;
}

.data-table tr.row-total {
  background-color: var(--bpjs-green-soft);
  font-weight: bold;
}

.grid-table-box {
  background: #FFFFFF;
  border: 1px solid var(--bpjs-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-top: 8px;
}

.grid-table-box h4 {
  font-size: 12px;
  color: var(--bpjs-dark);
  margin-bottom: 8px;
}

/* Action Bar Bawah */
.bottom-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-top: 1px solid var(--bpjs-border);
  padding: 8px 16px;
  z-index: 85;
  box-shadow: 0 -1px 6px rgba(0,0,0,0.06);
}

.action-container {
  max-width: 1050px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.action-status {
  font-size: 12px;
  color: var(--bpjs-green);
  font-weight: bold;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  bottom: 105%;
  background: #FFFFFF;
  min-width: 270px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border-radius: var(--radius);
  border: 1px solid var(--bpjs-border);
  padding: 4px 0;
  z-index: 100;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: none;
  border: none;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
  color: var(--bpjs-dark);
  font-family: inherit;
}

.dropdown-item:hover {
  background-color: var(--bpjs-green-soft);
  color: var(--bpjs-green-dark);
}

.dropdown-divider {
  height: 1px;
  background: var(--bpjs-border);
  margin: 3px 0;
}

/* Modal Archive */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-dialog {
  background: #FFFFFF;
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}

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

.modal-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--bpjs-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 14px 16px;
  overflow-y: auto;
}

.archive-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 180px;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.archive-table th, .archive-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--bpjs-border);
  text-align: left;
}

.archive-table th {
  background: #F8F9FA;
  color: #495057;
}

/* Preview TTD */
.ttd-preview-box {
  height: 65px !important;
  max-height: 65px !important;
  width: 100% !important;
  overflow: hidden !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: 4px;
  margin-top: 8px;
  position: relative;
  box-sizing: border-box;
}

.ttd-preview-img {
  max-height: 50px !important;
  max-width: 130px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
}

/* Template Dokumen PDF (A4) */
.pdf-print-area {
  display: none;
  background: #FFFFFF;
  color: #000000;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 8.5pt;
  line-height: 1.25;
  padding: 0 !important;
  margin: 0 !important;
}

.pdf-chapter-page {
  page-break-before: always;
  break-before: page;
  box-sizing: border-box;
  padding: 8mm 6mm 4mm 6mm;
  min-height: 275mm;
  height: auto;
  position: relative;
}

.pdf-chapter-page:first-child {
  page-break-before: avoid !important;
  break-before: avoid !important;
}

/* Cover */
.pdf-cover-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 40mm !important;
}

.pdf-cover-title {
  text-align: center;
  font-weight: bold;
  font-size: 13pt;
  line-height: 1.4;
  text-transform: uppercase;
  font-family: Arial, Helvetica, sans-serif !important;
}

/* Revisi: Nama RS tanpa garis bawah */
.pdf-cover-faskes {
  font-size: 14pt;
  text-decoration: none !important;
  display: inline-block;
  margin: 15px 0;
}

.pdf-chapter-header {
  text-align: center;
  font-weight: bold;
  font-size: 10.5pt;
  line-height: 1.3;
  margin-bottom: 12px;
  text-transform: uppercase;
  font-family: Arial, Helvetica, sans-serif !important;
}

.pdf-section-title {
  font-weight: bold;
  font-size: 9pt;
  margin: 8px 0 3px 0;
  font-family: Arial, Helvetica, sans-serif !important;
}

.pdf-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 9pt;
  font-family: Arial, Helvetica, sans-serif !important;
}

.pdf-meta-table td {
  padding: 3px 4px;
  vertical-align: top;
}

.pdf-data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 6px;
  font-size: 8pt;
  font-family: Arial, Helvetica, sans-serif !important;
  page-break-inside: avoid !important;
}

.pdf-data-table th, .pdf-data-table td {
  border: 1px solid #000000;
  padding: 3px 5px;
  vertical-align: middle;
}

.pdf-data-table th {
  background-color: #F2F2F2;
  text-align: center;
  font-weight: bold;
}

.pdf-sign-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif !important;
  page-break-inside: avoid !important;
}

.pdf-sign-table td {
  border: 1px solid #000000;
  padding: 6px 8px;
  vertical-align: top;
  width: 50%;
  font-size: 8.5pt;
}

.pdf-bullet-list {
  margin: 3px 0 6px 16px;
  padding-left: 0;
  font-size: 8.2pt;
}

.pdf-bullet-list li {
  margin-bottom: 2px;
}

/* Responsif Mobile */
@media (max-width: 768px) {
  body {
    padding-bottom: 90px;
    font-size: 13px;
  }

  .header-container {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .brand-text h1 {
    font-size: 13px;
  }

  .brand-text p {
    font-size: 10px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 4px;
    gap: 6px;
  }

  .btn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .section-tabs {
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .tab-item {
    flex: 0 0 auto;
    min-width: auto;
    padding: 6px 12px;
    font-size: 11.5px;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .col-12, .col-6, .col-4, .col-3 {
    grid-column: span 1 !important;
  }

  input[type="text"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 14px !important;
    padding: 9px 10px;
    border-radius: 4px;
  }

  .form-card {
    padding: 14px 12px;
  }

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

  .radio-card {
    width: 100%;
    padding: 10px 12px;
  }

  .inner-box {
    padding: 12px;
  }

  .action-container {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .action-buttons {
    width: 100%;
    display: flex;
  }

  .action-buttons .btn,
  .action-buttons .dropdown {
    flex: 1;
  }

  .action-buttons .dropdown button {
    width: 100%;
  }

  .dropdown-menu {
    left: 0;
    right: 0;
    min-width: 100%;
  }

  .modal-dialog {
    max-width: 100%;
    height: 90vh;
    margin: 0;
  }
}

/* Media Print untuk cetak langsung via browser */
@media print {
  body * {
    visibility: hidden;
  }
  #official-pdf-template,
  #official-pdf-template * {
    visibility: visible;
  }
  #official-pdf-template {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    display: block !important;
  }
  .pdf-chapter-page {
    page-break-before: always !important;
    break-before: page !important;
  }
  .pdf-chapter-page:first-child {
    page-break-before: avoid !important;
    break-before: avoid !important;
  }
}