/* aplikasi/rubrik-penilaian/app.css — Admin Guru | v2.0 | 2026-05-02 */
@import url('../../shared/stepper.css');
@import url('../../shared/panel-layout.css');
@import url('../../shared/form-base.css');
@import url('../../shared/dokumen-list.css');
@import url('../../shared/components.css');

/* ══════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════ */

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

body {
  font-family: var(--font-ui);
  font-size: 13px;
  background: var(--ui-bg);
  color: var(--ink);
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════
   LAYOUT UTAMA
   ══════════════════════════════════════════ */

.app-container {
  display: flex;
  height: calc(100vh - var(--header-height, 56px));
  overflow: hidden;
}

/* Panel kiri — override rasio dari panel-layout.css */
.panel-input {
  width: 30%;
  min-width: 300px;
  background: var(--color-bg-panel);
  border-right: 1px solid var(--color-border-panel);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height, 56px));
  overflow: hidden;
  transition: width 0.3s ease;
}

.panel-input.collapsed {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-right: none;
}

/* Panel kanan */
.panel-preview {
  flex: 1;
  height: calc(100vh - var(--header-height, 56px));
  overflow-y: auto;
  background: var(--ui-bg);
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
}

.panel-preview.expanded {
  width: 100%;
}

/* ══════════════════════════════════════════
   PANEL CONTENT & SCROLL
   ══════════════════════════════════════════ */

.panel-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.panel-content-inner {
  flex: 1;
  overflow-y: auto;
  display: block;
  padding: 0;
  height: calc(100vh - var(--header-height, 56px) - 80px);
}

/* ══════════════════════════════════════════
   MODULE PANEL & FORM SECTIONS
   ══════════════════════════════════════════ */

.module-panel {
  display: none;
  width: 100%;
}

.module-panel.active {
  display: block;
  animation: fadeSlideIn 0.25s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-section-group {
  margin: 12px 16px;
  border: 1px solid var(--color-border-panel);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-panel);
}

.form-section-group .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-bg-section);
  border-bottom: 1px solid var(--color-border-panel);
  cursor: default;
}

.form-section-group .section-title {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.form-section-group .section-title::before {
  display: none;
}

.form-section-group .section-body {
  padding: 14px;
  max-height: none;
  opacity: 1;
  margin-top: 0;
}

.btn-next {
  width: 100%;
  padding: 11px;
  background: var(--color-accent);
  color: var(--color-btn-primary-txt);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}

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

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-label);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.field-row .field-label {
  margin-bottom: 0;
  min-width: 140px;
}

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

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-row select,
.input-row input {
  flex: 1;
}

.input-readonly {
  background: var(--color-bg-section) !important;
  color: var(--color-text-muted) !important;
  cursor: default;
}

.input-small {
  width: 60px !important;
  flex: none !important;
}

.textarea-json {
  height: 90px;
  font-family: var(--font-mono);
  font-size: 11px;
  margin-bottom: 8px;
}

.textarea-hasil {
  height: 120px;
  font-family: var(--font-mono);
  font-size: 10px;
  margin-bottom: 6px;
  margin-top: 6px;
}

.textarea-drawer {
  height: 80px;
  font-family: var(--font-mono);
  font-size: 11px;
  width: 100%;
}

/* ══════════════════════════════════════════
   TOMBOL MUAT DATA
   ══════════════════════════════════════════ */

.btn-muat {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 7px 12px;
  font-size: 12px;
  background: var(--color-btn-secondary);
  color: var(--color-btn-secondary-txt);
  border: 1px solid var(--color-border-panel);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

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

/* ══════════════════════════════════════════
   ACCORDION PASTE MANUAL
   ══════════════════════════════════════════ */

.paste-manual-accordion {
  margin-top: 8px;
  border: 1px dashed var(--color-border-panel);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.paste-manual-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--color-bg-section);
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.paste-manual-toggle:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.paste-manual-chevron {
  font-size: 9px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.paste-manual-body {
  padding: 0 12px 12px;
  background: var(--color-bg-panel);
}

/* ══════════════════════════════════════════
   RADIO GROUP
   ══════════════════════════════════════════ */

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--color-text-primary);
  cursor: pointer;
}

.radio-label input[type="radio"] {
  width: auto;
  margin: 0;
  accent-color: var(--color-accent);
}

/* ══════════════════════════════════════════
   TOMBOL — SCOPED KE PANEL INPUT
   ══════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-bottom: 6px;
}

.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.97); }

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

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

.btn-secondary {
  background: var(--color-bg-section);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-panel);
}

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

/* ══════════════════════════════════════════
   RINGKASAN BOX
   ══════════════════════════════════════════ */

.ringkasan-box {
  background: var(--color-bg-section);
  border: 1px solid var(--color-border-panel);
  border-left: 3px solid var(--color-btn-success);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 11px;
  color: var(--color-text-primary);
  margin-top: 8px;
  line-height: 1.7;
}

.ringkasan-box .rk-judul {
  font-weight: 700;
  color: var(--color-btn-success);
  margin-bottom: 4px;
  font-size: 12px;
}

.ringkasan-box .rk-baris {
  display: flex;
  gap: 6px;
}

.ringkasan-box .rk-key {
  color: var(--color-text-muted);
  min-width: 90px;
}

.ringkasan-box .rk-val {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* ══════════════════════════════════════════
   PREVIEW AREA
   ══════════════════════════════════════════ */

.preview-area {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* ══════════════════════════════════════════
   DRAWER PENGGABUNG
   ══════════════════════════════════════════ */

.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 100;
}

.drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100vh;
  background: var(--color-bg-panel);
  border-left: 1px solid var(--color-border-panel);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transition: right 0.25s ease;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.drawer.aktif { right: 0; }
.drawer-overlay.aktif { display: block; }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 2px solid var(--color-accent);
  background: var(--color-bg-panel);
  flex-shrink: 0;
}

.drawer-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.drawer-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.drawer-close:hover { background: var(--color-bg-hover); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}

.drawer-instruksi {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  line-height: 1.6;
  padding: 8px;
  background: var(--color-bg-section);
  border-radius: var(--radius-sm);
}

.drawer-form-group {
  margin-bottom: 12px;
}

.drawer-form-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-label);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}

.gabungan-sukses {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-btn-success);
  margin-bottom: 6px;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 1024px) {
  .panel-input {
    width: 34%;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .panel-input {
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: 55vh;
    border-right: none;
    border-bottom: 1px solid var(--color-border-panel);
  }

  .panel-preview {
    height: auto;
    min-height: 45vh;
  }

  .drawer {
    width: 100%;
    right: -100%;
  }
}

@media (max-width: 480px) {
  .panel-input {
    max-height: 60vh;
  }
}

/* ══════════════════════════════════════════
   PRINT — SEMBUNYIKAN UI
   ══════════════════════════════════════════ */

@media print {
  .app-container, .panel-input,
  .drawer, .drawer-overlay { display: none !important; }
}
