.identitas-app .topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

body.print-mode .main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

body.print-mode .identitas-hide-print {
  display: none !important;
}

body.print-mode .topbar {
  order: 2;
  justify-content: flex-start;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

body.print-mode #panel-pilih-murid {
  order: 1;
  max-width: 640px;
}

body.print-mode #panel-pilih-murid .form-grid {
  margin-bottom: 1rem;
}

body.print-mode .topbar-actions {
  width: 100%;
  max-width: 640px;
  justify-content: flex-start;
  margin-bottom: 0.5rem;
}

.btn-primary { background: #4f46e5; color: #fff; border: none; padding: 10px 16px; border-radius: 10px; font-weight: 600; cursor: pointer; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline.sm { padding: 6px 12px; font-size: 13px; margin-top: 8px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; font-weight: 600; color: #334155; }
.field input, .field select, .field textarea {
  border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 12px; font: inherit;
}
.sub-title { margin: 18px 0 8px; font-size: 15px; }
.alert { margin-bottom: 16px; padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.alert.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alert.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert.hidden { display: none; }

.siswa-preview-panel {
  padding-top: 0.5rem;
}

.siswa-preview-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  max-width: 760px;
}

.siswa-preview-photo {
  flex: none;
  width: 92px;
  height: 118px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.siswa-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.siswa-preview-photo-none {
  color: #cbd5e1;
  font-size: 1.4rem;
}

.siswa-preview-body h2 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  line-height: 1.3;
}

.siswa-preview-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 1.25rem;
  margin: 0 0 0.85rem;
}

.siswa-preview-meta div {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 0.35rem;
  font-size: 0.84rem;
}

.siswa-preview-meta dt {
  margin: 0;
  color: #64748b;
  font-weight: 600;
}

.siswa-preview-meta dd {
  margin: 0;
  color: #0f172a;
}

@media (max-width: 640px) {
  .siswa-preview-card { flex-direction: column; }
  .siswa-preview-meta { grid-template-columns: 1fr; }
}

#section-catatan {
  background: #f8fbff;
  border: 1px solid #bfdbfe;
  box-shadow: inset 0 0 0 1px #dbeafe;
}

#section-catatan h2 {
  color: #1d4ed8;
}

#section-catatan .sub-title {
  color: #1e3a8a;
}

#section-catatan .sub-title-catatan {
  font-size: 16px;
}

#section-catatan .sub-title-prestasi {
  color: #15803d;
}

#section-catatan .sub-title-catatan-lainnya {
  color: #dc2626;
}

#section-catatan .data-table thead th {
  background: #dbeafe;
  color: #1e3a8a;
}

.catatan-meta {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #bfdbfe;
}

.catatan-meta-table {
  width: 100%;
  border-collapse: collapse;
}

.catatan-meta-table td {
  width: 50%;
  vertical-align: top;
  padding: 0 8px 0 0;
}

.catatan-meta-row {
  display: grid;
  grid-template-columns: 90px 12px 1fr;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 14px;
}

.catatan-meta-row .label {
  font-weight: 600;
  color: #334155;
}

.catatan-meta-row .sep {
  color: #64748b;
}

.import-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.import-filename { margin-top: 10px; font-size: 13px; color: #64748b; }
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }
.file-btn input { display: none; }

.template-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.template-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 1100px;
}

.tpl-row-nama {
  grid-template-columns: 28px 200px minmax(520px, 1fr);
}

.tpl-input-nama {
  min-width: 520px;
  max-width: 100%;
}

.tpl-input-alamat-wali {
  min-width: 520px;
  min-height: 88px;
  max-width: 100%;
  resize: vertical;
}

.tpl-row,
.tpl-sub {
  display: grid;
  grid-template-columns: 28px 200px 1fr;
  gap: 10px;
  align-items: start;
}

.tpl-row-2 {
  grid-template-columns: 28px 200px 1fr 28px 160px 120px;
}

.tpl-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.tpl-sub {
  grid-template-columns: 48px 152px 1fr;
  padding-left: 28px;
}

.tpl-no {
  font-weight: 700;
  color: #334155;
  padding-top: 10px;
}

.tpl-label,
.tpl-sub-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  padding-top: 10px;
}

.tpl-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.tpl-input.readonly {
  background: #f8fafc;
  color: #475569;
}

.tpl-inline {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 8px;
}

.tpl-short {
  max-width: 180px;
}

@media (max-width: 768px) {
  .tpl-row,
  .tpl-sub,
  .tpl-row-2 {
    grid-template-columns: 1fr;
  }

  .tpl-sub { padding-left: 0; }
  .tpl-no, .tpl-label, .tpl-sub-label { padding-top: 0; }
  .tpl-inline { grid-template-columns: 1fr; }
  .tpl-short { max-width: none; }
  .tpl-input-nama { min-width: 0; }
  .tpl-input-alamat-wali { min-width: 0; min-height: 72px; }
  .tpl-row-nama { grid-template-columns: 1fr; }
}

/* Perbesar area input tabel agar teks panjang tetap terlihat */
#tbl-prestasi td input,
#tbl-prestasi td select,
#tbl-catatan td input,
#tbl-catatan td select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}

#tbl-catatan td .c-catatan {
  min-width: 360px;
}

#tbl-prestasi td .select-lainnya-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

#tbl-prestasi td .p-tingkat-lain,
#tbl-prestasi td .p-juara-lain {
  min-width: 140px;
}

#tbl-prestasi td .p-tingkat {
  min-width: 140px;
}

#tbl-prestasi td .p-juara {
  min-width: 170px;
}

#tbl-prestasi td .p-kegiatan {
  min-width: 240px;
}

@media (max-width: 768px) {
  .form-grid.two-col { grid-template-columns: 1fr; }
}
