/* ===== CSS VARIABLES ===== */
:root {
  --ink         : #1a1a1a;
  --ink-light   : #4a4a4a;
  --ink-faint   : #8a8a8a;
  --paper       : var(--color-bg-app);
  --paper-warm  : var(--color-bg-section);
  --ui-bg       : var(--color-bg-app);
  --ui-border   : var(--color-border-panel);
  --accent      : var(--color-accent);
  --accent-light: var(--color-accent-hover);
  --rule        : var(--color-border-panel);
  --rule-dark   : var(--color-border-input);
  --shadow      : 0 2px 20px rgba(0,0,0,0.08),
                  0 1px 4px rgba(0,0,0,0.04);
  --ui-font     : var(--font-ui);
  --header-height: 60px;
  --radius-sm   : var(--radius-md);
  --radius-md   : var(--radius-lg);
}

[data-theme="dark"] {
  --ink       : #deddda;
  --ink-light : #9a9996;
  --ink-faint : #77767b;
  --paper     : #1a1a1a;
  --paper-warm: #2d2d2d;
  --ui-bg     : #1a1a1a;
  --ui-border : #3d3d3d;
  --accent    : #e07b39;
  --rule      : #3d3d3d;
  --rule-dark : #4d4d4d;
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--ui-font);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER APLIKASI ===== */
.app-header {
  background: var(--color-bg-app-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--paper);
  padding: 0 28px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04), 0 4px 32px rgba(0,0,0,0.3);
}

.app-title {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.app-title-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

.app-name {
  font-family: var(--ui-font);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

.app-subtitle {
  font-family: var(--ui-font);
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.selector-grid {
  display: contents;
}

/* Header action buttons - horizontal row (override base .action-buttons) */
.header-actions .action-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 0;
  flex-shrink: 1;
  min-width: 0;
}

.btn-toggle-panel {
  background: rgba(0,0,0,0.25);
  color: var(--color-text-app-header);
  border: 1px solid rgba(0,0,0,0.3);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin: 0;
  margin-right: auto;
  transition: background 0.2s ease;
  line-height: 1;
}

.btn-toggle-panel:hover {
  background: rgba(0,0,0,0.4);
}

/* ===== THEME SELECTOR STYLING ===== */
.theme-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  margin-right: 12px;
}

.theme-label {
  font-size: 0.9rem;
  color: var(--color-text-app-header);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.theme-label:hover {
  opacity: 0.7;
}

.theme-select {
  background: rgba(255,255,255,0.15);
  color: var(--color-text-app-header);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.theme-select:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.3);
}

.theme-select:focus {
  border-color: rgba(255,255,255,0.5);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
}

.theme-select option {
  background: var(--color-bg-app-header);
  color: var(--color-text-app-header);
}

/* ═══════════════════════════════════════════
   HEADER RESPONSIVE - COMPREHENSIVE
   ═══════════════════════════════════════════ */

/* Tablet (≤768px) */
@media (max-width: 768px) {
    .app-header {
        padding: 0 16px;
        height: 56px;
    }

    .app-title {
        gap: 8px;
    }

    .app-name {
        font-size: 1.2rem;
        max-width: 200px;
    }

    .app-subtitle {
        display: none;
    }

    .btn-toggle-panel {
        padding: 4px 8px;
        font-size: 0.9rem;
    }

    .theme-selector-wrapper {
        padding: 4px 8px;
        margin-right: 8px;
    }

    .theme-label {
        font-size: 0.8rem;
    }

    .theme-select {
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    .btn-dashboard {
        padding: 6px 12px;
        font-size: 11px;
    }

    .btn {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .header-actions {
        gap: 6px;
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
    }

    .header-left {
        gap: 8px;
        flex-shrink: 0;
    }

    .btn-print span,
    .btn-simpan-cloud span {
        display: none;
    }
}

/* Mobile besar (≤480px) */
@media (max-width: 480px) {
    .app-header {
        padding: 0 12px;
        height: auto;
        min-height: 52px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .app-title {
        gap: 6px;
        flex: 1;
        min-width: 0;
    }

    .app-name {
        font-size: 1rem;
        max-width: 150px;
    }

    .app-subtitle {
        display: none;
    }

    .btn-toggle-panel {
        padding: 4px 6px;
        font-size: 0.85rem;
    }

    /* Theme selectors - compact */
    .theme-selector-wrapper {
        padding: 3px 6px;
        margin-right: 0;
        gap: 4px;
    }

    .theme-label {
        font-size: 14px;
    }

    .theme-select {
        font-size: 10px;
        padding: 2px 4px;
        max-width: 80px;
    }

    /* Dashboard button - icon only */
    .btn-dashboard {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px 8px;
        min-width: 34px;
        min-height: 34px;
        flex-shrink: 0;
        align-self: center;
    }

    .header-left {
        width: 100%;
        gap: 6px;
        flex-shrink: 0;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
        overflow: visible;
        align-items: center;
    }

    .selector-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        flex: 1;
        gap: 6px;
        min-width: 0;
    }

    .header-actions .action-buttons {
        width: 100%;
        gap: 4px;
        flex-shrink: 1;
        min-width: 0;
    }

    .header-actions .btn-print,
    .header-actions .btn-simpan-cloud {
        flex: 1;
        padding: 6px 4px;
        min-width: 0;
        justify-content: center;
        white-space: nowrap;
    }

    .header-actions .btn-print span,
    .header-actions .btn-simpan-cloud span {
        display: none;
    }

    .btn-dashboard span {
        display: none;
    }
}

/* Mobile kecil (≤375px) */
@media (max-width: 375px) {
    .app-header {
        padding: 0 8px;
        gap: 6px;
    }

    .app-title {
        gap: 4px;
    }

    .app-name {
        font-size: 0.9rem;
        max-width: 120px;
    }

    .btn-toggle-panel {
        padding: 3px 5px;
        font-size: 0.8rem;
    }

    .theme-selector-wrapper {
        padding: 2px 4px;
    }

    .theme-select {
        font-size: 9px;
        padding: 2px 3px;
        max-width: 70px;
    }

    .btn-dashboard {
        padding: 5px;
        min-width: 32px;
    }

    .btn-print,
    .btn-simpan-cloud {
        padding: 5px 3px;
    }
}

/* ===== BUTTONS ===== */
.btn {
  font-family: var(--ui-font);
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-print {
  background: var(--accent);
  color: white;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 12px rgba(46,123,196,0.4);
}

.btn-print:hover {
  background: var(--accent-light);
  box-shadow: 0 4px 20px rgba(46,123,196,0.6);
  transform: translateY(-2px);
}

.btn-dashboard {
  background: var(--accent);
  color: white;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 2px 8px rgba(46,123,196,0.3);
  white-space: nowrap;
}

.btn-dashboard:hover {
  background: var(--accent-light);
  box-shadow: 0 4px 16px rgba(46,123,196,0.5);
  transform: translateY(-1px);
}

.btn-dashboard:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(46,123,196,0.3);
}

.btn-generate {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 12px rgba(46,123,196,0.4);
  margin-top: 6px;
}

.btn-generate:hover {
  background: var(--accent-light);
  box-shadow: 0 4px 20px rgba(46,123,196,0.6);
  transform: translateY(-2px);
}

.btn-copy {
  width: 100%;
  background: var(--ink-light);
  color: white;
  border: 1px solid var(--ink-light);
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 8px;
}

.btn-copy:hover {
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.btn-render {
  width: 100%;
  background: var(--color-btn-success);
  color: white;
  border: none;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 12px rgba(40, 167, 69, 0.3);
  margin-top: 6px;
}

.btn-render:hover {
  background: var(--color-btn-success-hv);
  box-shadow: 0 4px 20px rgba(40, 167, 69, 0.4);
  transform: translateY(-2px);
}

/* ===== FORM DIVIDER ===== */
.form-divider {
  height: 1px;
  background: var(--rule);
  margin: 16px 0;
  opacity: 0.6;
}

/* ===== MAIN LAYOUT ===== */
.app-body {
  flex: 1;
  display: grid;
  grid-template-columns: 30% 70%;
  gap: 0;
  height: calc(100vh - var(--header-height));
  transition: grid-template-columns 0.3s ease;
}

.app-body.expanded {
  grid-template-columns: 0 100%;
}

/* ===== PANEL KIRI ===== */
.panel-kiri {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--rule-dark);
  background: var(--ui-bg);
  overflow: hidden;
  height: calc(100vh - 60px);
  transition: width 0.3s ease, padding 0.3s ease;
}

.panel-kiri.collapsed {
  width: 0;
  padding: 0;
  overflow: hidden;
  border-right: none;
}

/* Panel content wrapper — holds stepper + module panels */
.panel-kiri > .panel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== PANEL KANAN ===== */
.panel-kanan {
  display: flex;
  flex-direction: column;
  background: #e8eaed;
  overflow-y: auto;
  height: calc(100vh - 60px);
}

/* ===== PANEL LABEL ===== */
.panel-label {
  padding: 12px 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
  background: var(--paper-warm);
  font-family: 'JetBrains Mono', monospace;
  border-left: 3px solid var(--accent);
  position: relative;
}

/* ===== PANEL CONTENT ===== */
.panel-content {
  flex: 1;
  padding: 0;
  display: block;
}

.form-container {
  padding: 14px;
}

/* ===== FORM SECTIONS ===== */
.form-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* ===== FORM GROUPS ===== */
.form-group {
  margin-bottom: 10px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-family: var(--ui-font);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
  letter-spacing: 0.01em;
}

/* ===== INPUT STYLES ===== */
textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-sm);
  font-family: var(--ui-font);
  font-size: 0.78rem;
  color: var(--ink);
  background: var(--color-bg-panel);
  transition: all 0.18s ease;
  outline: none;
  resize: vertical;
  min-height: 90px;
  line-height: 1.4;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 123, 196, 0.1);
}

textarea::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

input[type="text"],
input[type="date"],
input[type="number"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--ui-border);
  border-radius: var(--radius-sm);
  font-family: var(--ui-font);
  font-size: 0.78rem;
  color: var(--ink);
  background: var(--color-bg-panel);
  transition: all 0.18s ease;
  outline: none;
  margin-bottom: 0;
}
input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px
    rgba(224,123,57,0.15);
}
input[type="text"]::placeholder,
textarea::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

#jsonInput {
  min-height: 200px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
}

/* ── Paste Manual Collapsible ── */
.btn-paste-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 2px;
    transition: color 0.2s ease;
    font-family: var(--ui-font);
}

.btn-paste-toggle:hover {
    color: var(--accent-light);
}

.paste-manual-panel {
    display: none;
    margin-top: 8px;
    padding: 10px;
    border: 1px dashed var(--ui-border);
    border-radius: var(--radius-sm);
    background: var(--paper-warm);
}

.paste-manual-panel.open {
    display: block;
    animation: fadeSlideIn 0.2s ease;
}

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

/* ── Status message compact ── */
.status-msg {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
}

/* ===== PREVIEW BOX ===== */
.preview-box {
  background: #e8eaed;
  min-height: 100%;
  padding: 20px;
}

.preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--ink-faint);
  font-style: italic;
  font-size: 0.9rem;
}

/* ===== SCROLLBAR ===== */
.panel-kiri::-webkit-scrollbar,
.panel-kanan .panel-content::-webkit-scrollbar {
  width: 8px;
}

.panel-kiri::-webkit-scrollbar-track,
.panel-kanan .panel-content::-webkit-scrollbar-track {
  background: var(--paper-warm);
}

.panel-kiri::-webkit-scrollbar-thumb,
.panel-kanan .panel-content::-webkit-scrollbar-thumb {
  background: var(--rule-dark);
  border-radius: 4px;
}

.panel-kiri::-webkit-scrollbar-thumb:hover,
.panel-kanan .panel-content::-webkit-scrollbar-thumb:hover {
  background: var(--ink-faint);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .app-body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .panel-kiri {
    border-right: none;
    border-bottom: 1px solid var(--rule-dark);
  }

  .app-header {
    padding: 0 16px;
  }

  .app-name {
    font-size: 1.2rem;
  }

  .app-subtitle {
    font-size: 0.6rem;
  }

  .btn-print {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  html {
    height: auto !important;
    min-height: 0 !important;
  }

  body {
    height: auto !important;
    min-height: 0 !important;
    display: block !important;
    flex-direction: unset !important;
  }

  .app-header,
  .panel-kiri,
  .panel-label,
  ::-webkit-scrollbar {
    display: none !important;
  }

  .app-body,
  .panel-kanan {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: white !important;
  }

  .panel-kanan .panel-content {
    background: white !important;
    padding: 0 !important;
  }

  .preview-box {
    background: white !important;
    padding: 0 !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ── Fitur Simpan ke Cloud ── */
.btn-simpan-cloud {
    background: var(--color-accent, #e07b39);
    color: #fff;
    border: 1px solid #d46b30;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-simpan-cloud:hover {
    background: #d46b30;
    border-color: #c55f2a;
    transform: translateY(-1px);
}

.btn-simpan-cloud:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ═══ DOCUMENT LIST ITEMS — PROTA STYLE ═══ */
.dokumen-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--color-border-panel);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--color-bg-panel);
    transition: border-color 0.2s;
}

.dokumen-item:hover {
    border-color: var(--color-accent);
}

.dokumen-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.dokumen-nama {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dokumen-meta {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.dokumen-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-buka-dokumen {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--color-accent);
    background: transparent;
    color: var(--color-accent);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-buka-dokumen:hover {
    background: var(--color-accent);
    color: #fff;
}

.btn-hapus-dokumen {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--color-btn-danger);
    background: transparent;
    color: var(--color-btn-danger);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-hapus-dokumen:hover {
    background: var(--color-btn-danger);
    color: #fff;
}

.dokumen-kosong {
    font-size: 12px;
    color: var(--color-text-secondary);
    text-align: center;
    padding: 16px 0;
    font-style: italic;
}

/* ═══════════════════════════════════════════
   STEPPER NAVIGATOR — SHARED THEME
   ═══════════════════════════════════════════ */
.stepper-nav {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--color-bg-panel);
    border-bottom: 2px solid var(--color-border-panel);
    padding: 8px 12px;
    flex-shrink: 0;
    margin-bottom: 0;
    overflow-x: hidden;
}

.step-connector {
    flex: 1;
    height: 2px;
    background: var(--color-border-panel);
    min-width: 6px;
    max-width: 20px;
    transition: background 0.3s ease;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    border: none;
    background: none;
}

.step-item:hover {
    background: var(--color-bg-hover);
}

.step-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-border-panel);
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    border: 2px solid var(--color-border-panel);
}

/* step-label disembunyikan — tidak informatif di ruang sempit */
.step-label {
    display: none;
}

/* step-info hanya tampil di step active */
.step-info {
    display: none;
    flex-direction: column;
    gap: 1px;
    line-height: 1;
}

.step-item.active .step-info {
    display: flex;
}

.step-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-muted);
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* State: aktif (oranye) */
.step-item.active .step-circle {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--color-accent) 40%, transparent);
}

.step-item.active .step-label,
.step-item.active .step-title {
    color: var(--color-accent);
}

/* State: selesai (hijau) */
.step-item.done .step-circle {
    background: var(--color-btn-success);
    border-color: var(--color-btn-success);
    color: white;
}

.step-item.done .step-label,
.step-item.done .step-title {
    color: var(--color-btn-success);
}

.step-item.done + .step-connector {
    background: var(--color-btn-success);
}

/* Responsive stepper */
@media (max-width: 1024px) {
    .stepper-nav {
        padding: 6px 8px;
    }
    .step-circle {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    .step-connector {
        min-width: 4px;
    }
}

/* ═══════════════════════════════════════════
   STEP GUIDE BANNER — SHARED THEME
   ═══════════════════════════════════════════ */
.step-guide-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: color-mix(in srgb, var(--color-accent) 8%, transparent);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius-sm);
}

.step-guide-banner.step-guide-final {
    background: color-mix(in srgb, var(--color-btn-success) 8%, transparent);
    border-left-color: var(--color-btn-success);
}

.step-guide-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-guide-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.step-guide-text strong {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-primary);
    display: block;
}

.step-guide-text span {
    font-size: 0.72rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.step-guide-banner.step-guide-final .step-guide-text strong {
    color: var(--color-btn-success);
}

/* Responsive banner */
@media (max-width: 768px) {
    .step-guide-banner {
        padding: 10px 12px;
        gap: 10px;
    }

    .step-guide-icon {
        font-size: 20px;
    }

    .step-guide-text strong,
    .step-guide-text span {
        font-size: 12px;
    }
}

/* ═══════════════════════════════════════════
   MODULE PANEL — SHARED THEME
   ═══════════════════════════════════════════ */
.module-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.module-panel.active {
    display: flex;
    animation: fadeSlideIn 0.3s ease;
}

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

/* Panel content inner wrapper — scrollable area */
.panel-content-inner {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════════
   NAVIGASI TOMBOL LANJUT
   ═══════════════════════════════════════════ */
.btn-next {
    width: 100%;
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 12px color-mix(in srgb, var(--color-accent) 40%, transparent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: var(--ui-font);
}

.btn-next:hover {
    background: var(--color-accent-hover, #c4622e);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--color-accent) 60%, transparent);
    transform: translateY(-2px);
}

.btn-next:active {
    transform: translateY(0);
}

/* Success button */
.btn-success {
    width: 100%;
    background: var(--color-btn-success);
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: var(--ui-font);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--color-btn-success) 30%, transparent);
}

.btn-success:hover {
    background: var(--color-btn-success-hv, #256b29);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--color-btn-success) 50%, transparent);
    transform: translateY(-1px);
}

.btn-success:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════
   FORM SECTION - COLLAPSIBLE GROUPS
   ═══════════════════════════════════════════ */
.form-section-group {
    margin-bottom: 12px;
    border: 1px solid var(--color-border-panel);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 1px 3px color-mix(in srgb, black 6%, transparent);
}

.form-section-group .section-header {
    background: var(--color-bg-section);
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border-panel);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s ease;
}

.form-section-group .section-header:hover {
    background: var(--color-bg-hover);
}

.form-section-group .section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
}

.form-section-group .section-body {
    padding: 10px 12px;
}

.form-section-group .section-body .form-group {
    margin-bottom: 10px;
}

.form-section-group .section-body .form-group:last-child {
    margin-bottom: 0;
}

.form-section-group .section-body label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 3px;
    display: block;
}

/* ── PROMPT MODE SECTION ── */
.prompt-mode-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0;
}

.prompt-mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
}

.prompt-mode-buttons .btn-copy,
.prompt-mode-buttons .btn-copy-oneshot {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    margin-top: 0;
    font-size: 0.8rem;
    padding: 10px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.prompt-mode-buttons .btn-copy {
    background-color: #2563eb;
    color: white;
}

.prompt-mode-buttons .btn-copy-oneshot {
    background-color: #16a34a;
    color: white;
}

.prompt-mode-buttons .btn-copy:hover {
    background-color: #1d4ed8;
}

.prompt-mode-buttons .btn-copy-oneshot:hover {
    background-color: #15803d;
}

.prompt-mode-buttons .btn-copy.copy-sukses,
.prompt-mode-buttons .btn-copy-oneshot.copy-sukses {
    background-color: #6b7280 !important;
    color: #ffffff !important;
    border-color: transparent !important;
}

@media (max-width: 560px) {
    .prompt-mode-buttons {
        grid-template-columns: 1fr;
    }
}

.prompt-mode-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prompt-mode-info-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
    margin: 0;
}

.prompt-mode-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
}

.prompt-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.prompt-card-desc {
    font-size: 0.85rem;
    color: #475569;
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.prompt-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prompt-card-list li {
    font-size: 0.83rem;
    color: #334155;
}

.prompt-card-list li.plus {
    color: #16a34a;
}

.prompt-card-list li.minus {
    color: #dc2626;
}

.form-section-group .section-body input[type="text"],
.form-section-group .section-body input[type="date"],
.form-section-group .section-body input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-sm);
    font-family: var(--ui-font);
    font-size: 0.78rem;
    color: var(--ink);
    background: var(--color-bg-panel);
    transition: all 0.18s ease;
    outline: none;
}

.form-section-group .section-body input[type="text"]:focus,
.form-section-group .section-body input[type="date"]:focus,
.form-section-group .section-body input[type="number"]:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 15%, transparent);
}

.form-section-group .section-body textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-sm);
    font-family: var(--ui-font);
    font-size: 0.78rem;
    color: var(--ink);
    background: var(--color-bg-panel);
    transition: all 0.18s ease;
    outline: none;
    resize: vertical;
    line-height: 1.4;
}

.form-section-group .section-body textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 15%, transparent);
}

.form-section-group .section-body textarea::placeholder,
.form-section-group .section-body input::placeholder {
    color: var(--ink-faint);
    font-style: italic;
}

/* Monospace font for JSON textareas */
#jsonInput,
#jsonKktpInput {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.form-section-group .section-body .btn {
    margin-top: 6px;
}

/* Action buttons section — stacked buttons with status */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px 16px;
}

.action-buttons .btn {
    margin-top: 0;
}

.action-buttons .status-msg {
    margin-top: 4px;
}

/* Header action buttons — horizontal row */
.header-actions .btn-print,
.header-actions .btn-simpan-cloud {
    margin-top: 0;
    margin-left: 0;
    white-space: nowrap;
}

.toggle-icon {
    font-size: 16px;
    color: var(--ink-faint);
    transition: transform 0.2s ease;
}

/* Input row: dropdown + button side by side */
.input-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-row select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--ui-border);
    border-radius: var(--radius-sm);
    font-family: var(--ui-font);
    font-size: 0.78rem;
    color: var(--ink);
    background: var(--color-bg-panel);
    outline: none;
}

.input-row select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 15%, transparent);
}

.input-row .btn {
    align-self: flex-start;
    padding: 6px 14px;
    font-size: 0.78rem;
}

/* ═══════════════════════════════════════════
   EMPTY STATE PANEL PREVIEW — SHARED THEME
   ═══════════════════════════════════════════ */
.preview-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 32px;
    min-height: 400px;
}

.preview-empty-icon {
    font-size: 64px;
    opacity: 0.25;
    margin-bottom: 16px;
    user-select: none;
}

.preview-empty-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}

.preview-empty-desc {
    font-size: 13px;
    color: var(--ink-light);
    max-width: 360px;
    margin-bottom: 28px;
    line-height: 1.5;
}

.preview-empty-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.preview-empty-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border-panel);
    border-radius: var(--radius-sm);
    text-align: left;
    font-size: 13px;
    color: var(--ink);
    line-height: 1.4;
}

.preview-empty-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-accent);
    color: white;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.preview-empty-step-optional .preview-empty-step-num {
    background: var(--color-primary-mid, #2c5aa0);
}

.preview-empty-step-optional {
    opacity: 0.7;
}

/* Responsive empty state */
@media (max-width: 768px) {
    .preview-empty-state {
        padding: 32px 20px;
        min-height: 300px;
    }

    .preview-empty-icon {
        font-size: 48px;
    }

    .preview-empty-title {
        font-size: 16px;
    }

    .preview-empty-desc {
        font-size: 12px;
    }

    .preview-empty-step {
        padding: 8px 12px;
        font-size: 12px;
        gap: 10px;
    }

    .preview-empty-step-num {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}
