:root {
    /* Palette SD Muhammadiyah Serut */
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #14b8a6;
    --primary-subtle: #f0fdfa;
    --accent: #059669;
    --accent-gradient: linear-gradient(135deg, #0d9488 0%, #059669 100%);

    /* Sidebar Palette */
    --sidebar-bg: #09261d;
    --sidebar-bg-alt: #0d382c;
    --sidebar-text: rgba(255, 255, 255, 0.75);
    --sidebar-width: 260px;

    /* Surface & Background */
    --bg-app: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-subtle: #f8fafc;
    --border-focus: #0d9488;

    /* Shadows & Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 14px rgba(13, 148, 136, 0.1), 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ==========================================
   SIDEBAR NAVIGATION (GOJEK / SERUT DARK GREEN)
   ========================================== */
#sidebarOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}

#sidebarOverlay.active {
    display: block;
    opacity: 1;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s var(--ease);
    overflow-y: auto;
}

.sidebar-header {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
    flex-shrink: 0;
}

.brand-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.brand-text h1 {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.2px;
    line-height: 1.2;
}

.brand-text p {
    color: #5eead4;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.sidebar-menu {
    padding: 14px 10px;
    flex: 1;
}

.menu-category {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.4);
    padding: 12px 10px 6px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 3px;
    color: var(--sidebar-text);
    cursor: pointer;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.15s var(--ease);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-item.active {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.nav-item .material-icons-round {
    font-size: 19px;
    flex-shrink: 0;
}

.back-btn {
    color: #5eead4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    padding-bottom: 14px;
    margin-bottom: 10px;
}

.back-btn:hover {
    color: #ffffff;
    background: rgba(20, 184, 166, 0.12);
}

.badge-tag {
    margin-left: auto;
    background: #f59e0b;
    color: #0f172a;
    font-size: 9.5px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================
   MAIN CONTENT AREA (WITH SIDEBAR MARGIN)
   ========================================== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}

/* TOPBAR */
.app-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

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

.btn-hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px;
    cursor: pointer;
    color: var(--text-main);
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.topbar-breadcrumb .current {
    color: var(--text-main);
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* TAB VIEWS */
.view-panel {
    display: none;
    flex: 1;
}

.view-panel.active {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* IFRAME EMBED (E-SURAT & E-NOTULEN) */
.embed-box {
    width: 100%;
    height: calc(100vh - 65px);
    display: flex;
    flex-direction: column;
}

.embed-toolbar {
    background: #f8fafc;
    padding: 8px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
}

.embed-toolbar a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.embed-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

/* 1-SET GENERATOR STYLING */
.content-body {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    width: 100%;
}

.hero-box {
    background: linear-gradient(135deg, #09261d 0%, #0d9488 100%);
    color: #ffffff;
    padding: 24px 28px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: var(--shadow-md);
}

.hero-info h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}

.hero-info p {
    font-size: 13.5px;
    opacity: 0.9;
    max-width: 650px;
    line-height: 1.45;
}

.hero-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-tag-item {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 2-Column Grid */
.generator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1100px) {
    .generator-grid {
        grid-template-columns: 1fr;
    }
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.panel-title {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.panel-title i {
    color: var(--primary);
}

/* Form inputs */
.form-field {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #1e293b;
    background: #ffffff;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .row-2col {
        grid-template-columns: 1fr;
    }
}

/* Teacher list */
.teacher-scroll-box {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px;
    background: #f8fafc;
}

.teacher-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 6px;
    background: #ffffff;
    margin-bottom: 4px;
    border: 1px solid #f1f5f9;
    gap: 8px;
}

.teacher-name-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    flex: 1;
    cursor: pointer;
}

.teacher-role-dropdown {
    padding: 4px 8px;
    font-size: 11.5px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #ffffff;
}

/* Photo Uploader */
.dropzone-photo {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone-photo:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.thumbs-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.thumb-card {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    background: #000;
}

.thumb-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-thumb {
    position: absolute;
    top: 3px;
    right: 3px;
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

/* Action Buttons */
.btn-emerald {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
    transition: all 0.2s ease;
}

.btn-emerald:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.4);
}

.btn-blue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #1e40af;
    color: #ffffff;
    border: none;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-blue:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-gray {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* SYNC WITH E-NOTULEN BANNER */
.sync-banner {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sync-banner-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #0f766e;
    font-weight: 500;
}

/* DOCUMENT MODE TOGGLE */
.doc-mode-toggle {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: var(--radius-sm);
    gap: 3px;
    margin-bottom: 10px;
}

.mode-btn {
    border: none;
    background: transparent;
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.mode-btn.active {
    background: #ffffff;
    color: var(--primary-dark);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.scan-box-wrapper {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 8px;
    text-align: center;
}

/* MODAL PICK MEETING */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog {
    background: #ffffff;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 650px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

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

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.meeting-item-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.15s;
    background: #ffffff;
}

.meeting-item-card:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
    transform: translateY(-1px);
}

/* ==========================================
   DOCUMENT FOLIO (F4) PREVIEW (SHEETS)
   ========================================== */
.preview-stage {
    background: #94a3b8;
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    max-height: 880px;
    overflow-y: auto;
}

.sheet-a4,
.sheet-folio {
    background: #ffffff;
    width: 100%;
    max-width: 215mm;
    min-height: 330mm;
    margin: 0 auto 24px;
    padding: 18mm 18mm 18mm 22mm;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-family: "Times New Roman", Times, serif;
    font-size: 11.5pt;
    line-height: 1.45;
    color: #000000;
    position: relative;
    text-align: left;
    /* Sesuai kaidah naskah dinas resmi: default rata kiri */
}

/* Salam pembuka dan salam penutup resmi: Rata kiri, miring, spasi proporsional */
.salam-surat {
    text-align: left !important;
    text-indent: 0 !important;
    font-style: italic;
    line-height: 1.35 !important;
    margin-bottom: 12px;
}

/* Paragraf narasi/isi resmi EYD: Rata kanan-kiri, baris terakhir rata kiri, spasi 1.5 */
.paragraf-isi {
    text-indent: 30px;
    text-align: justify !important;
    text-justify: inter-word;
    text-align-last: left;
    line-height: 1.5 !important;
    margin-bottom: 14px;
}

/* Tabel rincian jadwal kegiatan */
.jadwal-rapat-table {
    width: 85%;
    margin: 0 auto 16px;
    font-size: 11.5pt;
    line-height: 1.4;
}

.jadwal-rapat-table td {
    padding: 3px 0;
    line-height: 1.4;
    text-align: left;
}

/* Lembar Notulen & SK: Konten deskripsi ber-alinea justified dengan baris terakhir rata kiri */
.sheet-folio #prev_notulen_pembahasan,
.sheet-folio #prev_notulen_keputusan {
    text-align: justify !important;
    text-justify: inter-word !important;
    text-align-last: left !important;
    line-height: 1.5 !important;
    padding-left: 14px;
}

.sheet-folio #prev_sk_menimbang,
.sheet-folio #prev_sk_mengingat,
.sheet-folio #prev_sk_memperhatikan,
.sheet-folio #prev_sk_diktum,
.sheet-folio #prev_sk_kesatu {
    text-align: justify !important;
    text-justify: inter-word !important;
    text-align-last: left !important;
    line-height: 1.45 !important;
}

.sheet-ribbon {
    position: absolute;
    top: 10px;
    right: 15px;
    background: #0f172a;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* KOP Surat Baru (Gambar Banner Asset) */
.kop-banner-wrap {
    width: 100%;
    text-align: center;
    margin-bottom: 16px;
    border-bottom: 3px double #000000;
    padding-bottom: 6px;
    transition: all 0.2s ease;
}

.kop-banner-img {
    width: 100%;
    max-height: 125px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: max-height 0.2s ease;
}

.kop-scale-compact .kop-banner-img {
    max-height: 85px !important;
}

.kop-scale-standard .kop-banner-img {
    max-height: 125px !important;
}

.kop-scale-full .kop-banner-img {
    max-height: 155px !important;
}

/* Kop Surat Format Teks (Fallback) */
.kop-surat-header {
    display: flex;
    align-items: center;
    border-bottom: 3px double #000000;
    padding-bottom: 10px;
    margin-bottom: 20px;
    gap: 14px;
}

.kop-logo-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.kop-text-box {
    flex: 1;
    text-align: center;
}

.kop-line-1 {
    font-size: 13pt;
    font-weight: bold;
    margin: 0;
}

.kop-line-2 {
    font-size: 16pt;
    font-weight: bold;
    margin: 2px 0 0;
    letter-spacing: 0.5px;
}

.kop-line-3 {
    font-size: 9.5pt;
    margin: 4px 0 0;
    font-style: italic;
}

/* Folio Margins & Densities */
.sheet-folio.margin-compact {
    padding: 13mm 15mm 13mm 18mm !important;
}

.sheet-folio.margin-standard {
    padding: 18mm 18mm 18mm 22mm !important;
}

.sheet-folio.margin-wide {
    padding: 24mm 24mm 24mm 28mm !important;
}

.sheet-folio.density-compact {
    font-size: 10.5pt !important;
    line-height: 1.35 !important;
}

.sheet-folio.density-standard {
    font-size: 11.5pt !important;
    line-height: 1.5 !important;
}

.sheet-folio.density-spacious {
    font-size: 12pt !important;
    line-height: 1.6 !important;
}

/* =========================================================
   FLEXIBLE SIGNATURE SYSTEM (POSISI TTD DAPAT DIATUR SEMUANYA)
   ========================================================= */
.signature-row {
    margin-top: 24px;
    display: flex;
    font-size: 11pt;
    width: 100%;
    position: relative;
    page-break-inside: avoid;
}

/* Posisi TTD: Dipinggir Kanan (Default Resmi Dinas) */
.signature-row.pos-right {
    justify-content: flex-end !important;
}

/* Posisi TTD: Dipinggir Kiri */
.signature-row.pos-left {
    justify-content: flex-start !important;
}

/* Posisi TTD: Tengah (Simetris) */
.signature-row.pos-center {
    justify-content: center !important;
}

/* Posisi TTD: Kiri & Kanan (2 Pihak: Mengetahui di Kiri, Notulis/Ketua di Kanan) */
.signature-row.pos-between {
    justify-content: space-between !important;
}

/* Posisi TTD: Kanan & Kiri (Kebalikan 2 Pihak) */
.signature-row.pos-reverse {
    justify-content: space-between !important;
    flex-direction: row-reverse !important;
}

/* Posisi TTD: 3 Pihak (Kepanitiaan / Berita Acara) */
.signature-row.pos-tripartite {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.signature-row.pos-tripartite .sig-row-top {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.signature-row.pos-tripartite .sig-row-bottom {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Signature Box & Elements */
.signature-box {
    text-align: center;
    min-width: 210px;
    max-width: 250px;
    position: relative;
    display: inline-block;
}

.signature-title {
    font-size: 11pt;
    line-height: 1.35;
    margin-bottom: 4px;
}

.signature-gap {
    height: 65px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: height 0.2s ease;
}

.gap-compact .signature-gap {
    height: 42px !important;
}

.gap-normal .signature-gap {
    height: 65px !important;
}

.gap-wide .signature-gap {
    height: 90px !important;
}

/* Cap Stempel Resmi Sekolah Realistis */
.school-stamp-img {
    position: absolute;
    width: 95px;
    height: 95px;
    object-fit: contain;
    opacity: 0.84;
    left: -15px;
    top: -12px;
    pointer-events: none;
    transform: rotate(-8deg);
    mix-blend-mode: multiply;
    z-index: 2;
    transition: opacity 0.2s ease;
}

/* QR Code Verifikasi Berkas */
.qr-verify-seal {
    width: 52px;
    height: 52px;
    border: 1px dashed #475569;
    border-radius: 4px;
    background: #f8fafc;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-family: 'Inter', sans-serif;
    color: #334155;
    margin-bottom: 2px;
}

.signature-name {
    font-weight: bold;
    text-decoration: underline;
    font-size: 11pt;
}

.signature-nip {
    font-size: 10pt;
    color: #000000;
    margin-top: 1px;
}

/* =========================================================
   DOCUMENT CONTENT STYLES (FOLIO SHEETS)
   ========================================================= */
.doc-center-title {
    text-align: center;
    font-weight: bold;
    font-size: 13pt;
    text-decoration: underline;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.doc-center-num {
    text-align: center;
    font-size: 11pt;
    margin-bottom: 16px;
}

.doc-formal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 11pt;
}

.doc-formal-table th,
.doc-formal-table td {
    border: 1px solid #000000;
    padding: 6px 8px;
    vertical-align: middle;
}

.doc-formal-table th {
    background-color: #f1f5f9;
    text-align: center;
    font-weight: bold;
}

.photo-grid-sheet {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}

.photo-card-sheet {
    border: 1px solid #cbd5e1;
    padding: 6px;
    text-align: center;
    background: #fff;
}

.photo-card-sheet img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 4px;
}

.photo-card-sheet p {
    font-size: 9pt;
    margin-top: 5px;
    font-style: italic;
}

/* History Table */
.data-table-simple {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table-simple th,
.data-table-simple td {
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.data-table-simple th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
}

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

/* Toast */
#kearsipanToast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

#kearsipanToast.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .btn-hamburger {
        display: flex;
    }
}

/* ==============================================================
   SEQUENTIAL WIZARD & STEPPER STYLES (E-KEARSIPAN)
   ============================================================== */
.step-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    color: var(--sidebar-text);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s var(--ease);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.step-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(2px);
}

.step-nav-item.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #5eead4;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.step-nav-item.active .step-num {
    background: #ffffff;
    color: #0d9488;
}

.step-nav-item.completed .step-num {
    background: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.step-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.step-title {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-desc {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.2;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-nav-item.active .step-desc {
    color: rgba(255, 255, 255, 0.9);
}

/* WIZARD PROGRESS BAR (FORM HEADER) */
.wizard-progress-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .wizard-progress-bar {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
}

@media (max-width: 550px) {
    .wizard-progress-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

.step-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    user-select: none;
}

.step-pill:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.step-pill.active {
    background: #f0fdfa;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.18);
}

.step-pill.completed {
    border-color: #a7f3d0;
    background: #f0fdf4;
}

.pill-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 10.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-pill.active .pill-num {
    background: var(--primary);
    color: #ffffff;
}

.step-pill.completed .pill-num {
    background: #059669;
    color: #ffffff;
}

.pill-text {
    font-size: 11.5px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-pill.active .pill-text {
    color: var(--primary-dark);
    font-weight: 700;
}

/* WIZARD SECTIONS */
.wizard-step-section {
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.wizard-step-section.active {
    display: block;
}

.wizard-nav-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* PREVIEW SHEET TABS */
.preview-sheet-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.preview-tab {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    padding: 5px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.preview-tab:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: #cbd5e1;
}

.preview-tab.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* ==========================================================
   MOBILE RESPONSIVE — TABLET (≤ 900px)
   ========================================================== */
@media (max-width: 900px) {

    /* Sidebar: tersembunyi, slide-in drawer */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Main wrapper: full width tanpa margin sidebar */
    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Hamburger tombol muncul */
    .btn-hamburger {
        display: flex !important;
    }

    /* Topbar lebih compact */
    .app-topbar {
        padding: 10px 14px;
    }

    .topbar-breadcrumb {
        font-size: 12px;
    }

    .topbar-breadcrumb span:first-child {
        display: none;
        /* Sembunyikan "E-Kearsipan >" di layar kecil */
    }

    .topbar-actions .btn-gray span {
        display: none;
        /* Sembunyikan teks tombol Portal, sisakan icon */
    }

    /* Content body padding dikurangi */
    .content-body {
        padding: 14px;
    }

    /* Hero box lebih compact */
    .hero-box {
        padding: 16px 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .hero-info h2 {
        font-size: 17px;
    }

    .hero-info p {
        font-size: 12.5px;
    }

    .hero-tags {
        display: none;
        /* Sembunyikan tags di mobile untuk hemat ruang */
    }

    /* Generator grid: single column */
    .generator-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    /* Preview panel: disembunyikan di mobile, muncul lewat tombol */
    .col-preview {
        display: none;
    }

    /* Wizard progress bar pills: bisa digeser horizontal */
    .wizard-progress-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        flex-wrap: nowrap !important;
        gap: 6px !important;
    }

    .wizard-progress-bar::-webkit-scrollbar {
        display: none;
    }

    .step-pill {
        flex-shrink: 0;
        min-width: auto;
    }

    .pill-text {
        display: none !important;
        /* Hanya tampilkan nomor di layar kecil */
    }

    .pill-num {
        font-size: 13px !important;
        width: 30px !important;
        height: 30px !important;
    }

    /* Sidebar step nav: lebih compact */
    .step-nav-item {
        padding: 10px 14px;
    }

    .step-num {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    /* Panel card padding dikurangi */
    .panel-card {
        padding: 14px;
    }

    /* Wizard nav footer: tombol full width */
    .wizard-nav-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .wizard-nav-footer .btn-emerald,
    .wizard-nav-footer .btn-gray {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    /* Teacher scroll box: tinggi disesuaikan */
    .teacher-scroll-box {
        max-height: 200px;
    }

    /* Modal dialog: full screen hampir */
    .modal-dialog {
        max-width: 100%;
        max-height: 92vh;
        margin: 0;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    /* Meeting item card: compact */
    .meeting-item-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .meeting-item-card .btn-emerald {
        width: 100%;
        justify-content: center;
    }

    /* Preview folio: tampilkan sebagai floating bottom bar */
    .col-preview {
        display: none;
    }
}

/* ==========================================================
   MOBILE RESPONSIF — HANDPHONE (≤ 600px)
   ========================================================== */
@media (max-width: 600px) {

    /* Topbar sangat compact */
    .app-topbar {
        padding: 8px 12px;
    }

    /* Content body: padding minimal */
    .content-body {
        padding: 10px;
    }

    /* Hero box: sangat compact */
    .hero-box {
        padding: 12px 14px;
        margin-bottom: 12px;
    }

    .hero-info h2 {
        font-size: 15px;
    }

    /* Panel card: padding minimal */
    .panel-card {
        padding: 12px;
        margin-bottom: 12px;
    }

    /* Input dan form lebih mudah disentuh */
    .form-control {
        padding: 10px 12px;
        font-size: 14px;
        /* Lebih besar untuk mudah dibaca di HP */
        min-height: 44px;
        /* Touch target minimum */
    }

    /* Tombol jadi lebih besar untuk jari */
    .btn-emerald,
    .btn-blue,
    .btn-gray {
        min-height: 44px;
        font-size: 13.5px;
    }

    /* Scan grid: 1 kolom saja di HP */
    .scan-grid-2col {
        grid-template-columns: 1fr !important;
    }

    /* Quick team buttons: scroll horizontal */
    .quick-team-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        padding-bottom: 4px;
    }

    /* Sync banner: stack vertikal */
    .sync-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sync-banner .btn-emerald {
        width: 100%;
        justify-content: center;
    }

    /* Mode toggle: full width */
    .doc-mode-toggle {
        display: flex;
        width: 100%;
    }

    .doc-mode-toggle .mode-btn {
        flex: 1;
        justify-content: center;
    }

    /* Teacher row item */
    .teacher-role-dropdown {
        font-size: 11px;
        padding: 6px 4px;
        max-width: 110px;
    }

    /* Form label lebih besar */
    .form-label {
        font-size: 13px;
    }

    /* Step nav items di sidebar */
    .step-desc {
        display: none;
        /* Sembunyikan deskripsi step di HP kecil */
    }
}

/* ==========================================================
   FLOATING PREVIEW BUTTON (MOBILE ONLY) — tampilkan pratinjau
   ========================================================== */
@media (max-width: 900px) {
    #floatPreviewBtn {
        display: flex !important;
    }
}

#floatPreviewBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 900;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
    align-items: center;
    gap: 8px;
    animation: floatPulse 2.5s ease-in-out infinite;
}

@keyframes floatPulse {

    0%,
    100% {
        box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
    }

    50% {
        box-shadow: 0 8px 28px rgba(13, 148, 136, 0.65);
        transform: translateY(-2px);
    }
}

/* Modal pratinjau folio di mobile */
#mobilePreviewModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: rgba(0, 0, 0, 0.7);
    align-items: flex-end;
    justify-content: center;
}

#mobilePreviewModal.active {
    display: flex;
}

#mobilePreviewInner {
    background: #fff;
    width: 100%;
    height: 90vh;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#mobilePreviewHeader {
    padding: 14px 16px;
    background: #0d9488;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 14px;
}

#mobilePreviewBody {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #94a3b8;
}

/* PRINT ONLY */
@media print {
    @page {
        size: 215mm 330mm;
        margin: 15mm 15mm 15mm 20mm;
    }

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

    body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .sidebar,
    .app-topbar,
    .hero-box,
    .panel-card,
    .wizard-progress-bar,
    .wizard-step-section,
    .wizard-nav-footer,
    .preview-sheet-tabs,
    #view-surat,
    #view-notulen,
    #view-history,
    .btn-emerald,
    .btn-blue,
    .btn-gray,
    .sheet-ribbon,
    #kearsipanToast,
    .layout-toolbar {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .content-body {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .generator-grid {
        display: block !important;
    }

    .preview-stage {
        background: #ffffff !important;
        padding: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .sheet-a4,
    .sheet-folio {
        width: 100% !important;
        min-height: auto !important;
        box-shadow: none !important;
        margin: 0 0 20mm 0 !important;
        page-break-after: always !important;
        break-after: page !important;
    }

    .signature-row {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .school-stamp-img {
        display: block !important;
        opacity: 0.85 !important;
    }
}

/* ==============================================================
   UI/UX REFINEMENT v2 — sidebar bisa di-hide, layout lebih lega
   ============================================================== */
:root {
    --topbar-h: 60px;
}

/* ---------- Tombol toggle sidebar ---------- */
.btn-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: #ffffff;
    transition: all 0.15s var(--ease);
}

.btn-hamburger:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.sidebar-collapse-btn {
    margin-left: auto;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.sidebar-collapse-btn .material-icons-round {
    font-size: 18px;
}

/* ---------- Sidebar: scrollbar tipis & fokus keyboard ---------- */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.nav-item:focus-visible,
.step-nav-item:focus-visible,
.sidebar-collapse-btn:focus-visible {
    outline: 2px solid #5eead4;
    outline-offset: 2px;
}

.main-wrapper {
    transition: margin-left 0.25s var(--ease), width 0.25s var(--ease);
}

/* ---------- Desktop ---------- */
@media (min-width: 901px) {
    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
        visibility: hidden;
        box-shadow: none;
        transition: transform 0.25s var(--ease), visibility 0s linear 0.25s;
    }

    body.sidebar-collapsed .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .app-topbar {
        min-height: var(--topbar-h);
        padding-top: 0;
        padding-bottom: 0;
    }

    .content-body {
        padding: 18px 24px 40px;
    }

    /* Hero lebih ringkas */
    .hero-box {
        padding: 14px 20px;
        margin-bottom: 16px;
    }

    .hero-info h2 {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .hero-info p {
        font-size: 12.5px;
        max-width: 760px;
    }

    /* Stepper menempel di bawah topbar */
    .wizard-progress-bar {
        position: sticky;
        top: var(--topbar-h);
        z-index: 20;
        background: var(--bg-app);
        padding: 10px 0;
        margin-bottom: 10px;
    }

    /* Tombol Kembali / Lanjut selalu terlihat */
    .wizard-nav-footer {
        position: sticky;
        bottom: 0;
        z-index: 15;
        background: var(--bg-app);
        margin-top: 8px;
        padding: 12px 0;
    }
}

@media (max-width: 1280px) {
    .hero-tags {
        display: none;
    }
}

@media (min-width: 1101px) {
    .generator-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        gap: 20px;
    }
}

/* ---------- Panel & form ---------- */
.panel-card {
    border-radius: var(--radius-lg);
}

.form-control {
    padding: 10px 12px;
}

.form-control:hover {
    border-color: #cbd5e1;
}

.form-control:focus {
    border-color: var(--border-focus);
}

/* ---------- Pratinjau Folio: skala otomatis, tidak terpotong ---------- */
.col-preview .panel-card {
    top: calc(var(--topbar-h) + 14px) !important;
    margin-bottom: 0;
    padding: 16px;
}

.col-preview .preview-stage {
    padding: 14px;
    max-height: calc(100vh - var(--topbar-h) - 210px);
    scrollbar-width: thin;
}

.col-preview .sheet-folio {
    zoom: var(--preview-zoom, 1);
}

.preview-sheet-tabs {
    scrollbar-width: thin;
}

@media print {
    .btn-hamburger,
    .sidebar-collapse-btn {
        display: none !important;
    }

    .col-preview .sheet-folio {
        zoom: 1 !important;
    }
}


/* ---------- v2.1: perbaikan stepper, sticky pratinjau, sidebar ---------- */
@media (min-width: 901px) {

    /* Stepper: pill non-aktif cukup nomor, yang aktif menampilkan label */
    .wizard-progress-bar {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        overflow: hidden;
    }

    .step-pill {
        flex: 0 0 auto;
        padding: 6px 8px;
    }

    .step-pill:not(.active) .pill-text {
        display: none;
    }

    .step-pill.active {
        flex: 1 1 auto;
        min-width: 0;
        padding-right: 14px;
    }

    /* Sidebar lebih ringkas agar muat tanpa banyak scroll */
    .sidebar-header {
        padding: 14px 16px;
    }

    .sidebar-menu {
        padding: 8px 10px;
    }

    .menu-category {
        padding: 10px 10px 4px;
    }

    .step-nav-item {
        padding: 7px 12px;
        margin-bottom: 3px;
    }

    .nav-item {
        padding: 8px 12px;
        margin-bottom: 2px;
    }

    .sidebar-footer {
        position: sticky;
        bottom: 0;
        background: var(--sidebar-bg);
        padding: 10px 16px;
    }
}
