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

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    background: #0a1628;
    color: #f1f5f9;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== SPLASH SCREEN ===== */
#splashScreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, #0a1628 0%, #1a0a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
}

.splash-content {
    text-align: center;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    z-index: 2;
    animation: splashFadeIn 1.2s ease forwards;
}

@keyframes splashFadeIn {
    0% { opacity: 0; transform: scale(0.95) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.splash-icon {
    font-size: 48px;
    color: #fbbf24;
    display: block;
    margin-bottom: 5px;
    animation: floatStar 3s ease-in-out infinite;
}

@keyframes floatStar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.splash-title {
    font-size: 52px;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 6px;
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.2);
    line-height: 1.1;
}

.splash-subtitle {
    font-size: 18px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 4px;
    margin-top: -2px;
}

.splash-year {
    font-size: 14px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 8px;
    margin-top: 2px;
}

.splash-divider {
    color: rgba(255, 255, 255, 0.15);
    font-size: 20px;
    margin: 15px 0;
}

.splash-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 20px;
    border-radius: 50px;
    font-size: 13px;
    color: #94a3b8;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
    margin-bottom: 20px;
}

.splash-credit {
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    margin-top: 15px;
}

.splash-credit strong {
    color: #fbbf24;
    font-weight: 600;
}

.splash-instansi {
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
    margin-top: 2px;
    font-style: italic;
}

.splash-btn {
    background: linear-gradient(135deg, #00d4ff, #2563eb);
    color: #ffffff;
    border: none;
    padding: 14px 50px;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    margin: 20px 0 15px;
    transition: all 0.4s ease;
    box-shadow: 0 4px 30px rgba(0, 212, 255, 0.25);
    letter-spacing: 2px;
    font-family: inherit;
}

.splash-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 40px rgba(0, 212, 255, 0.4);
}

.splash-btn:active {
    transform: scale(0.97);
}

.splash-footer {
    color: rgba(255, 255, 255, 0.2);
    font-size: 11px;
    letter-spacing: 2px;
}

/* ===== SPLASH PARTICLES ===== */
.splash-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.splash-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: particleFloat 8s infinite alternate ease-in-out;
}

.splash-particles span:nth-child(1) { top: 10%; left: 20%; animation-duration: 6s; }
.splash-particles span:nth-child(2) { top: 70%; left: 10%; animation-duration: 9s; }
.splash-particles span:nth-child(3) { top: 30%; left: 85%; animation-duration: 7s; }
.splash-particles span:nth-child(4) { top: 80%; left: 80%; animation-duration: 10s; }
.splash-particles span:nth-child(5) { top: 50%; left: 50%; animation-duration: 8s; }
.splash-particles span:nth-child(6) { top: 15%; left: 60%; animation-duration: 7s; }
.splash-particles span:nth-child(7) { top: 65%; left: 35%; animation-duration: 11s; }
.splash-particles span:nth-child(8) { top: 45%; left: 5%; animation-duration: 9s; }
.splash-particles span:nth-child(9) { top: 20%; left: 40%; animation-duration: 8s; }
.splash-particles span:nth-child(10) { top: 90%; left: 70%; animation-duration: 6s; }

@keyframes particleFloat {
    0% { transform: translate(0, 0) scale(1); opacity: 0.2; }
    100% { transform: translate(30px, -40px) scale(1.5); opacity: 0.8; }
}

/* ===== MAIN APP ===== */
#mainApp {
    display: none;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px 40px;
}

/* ===== HEADER ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    margin-bottom: 25px;
}

.header-left .header-logo {
    font-size: 16px;
    font-weight: 700;
    color: #00d4ff;
    letter-spacing: 1px;
}

.header-right .header-title {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.5px;
}

/* ===== GLASS CARD ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 12px;
}

.card-header .card-icon {
    font-size: 20px;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
    letter-spacing: 0.5px;
    flex: 1;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== LAYER INPUT ===== */
.layer-input {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ===== FORM GROUP ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.3px;
}

/* ===== INPUT GLASS ===== */
.input-glass {
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    padding: 10px 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #f1f5f9;
    border-radius: 0;
    transition: all 0.3s ease;
    width: 100%;
    outline: none;
}

.input-glass::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.input-glass:focus {
    border-bottom-color: #00d4ff;
    box-shadow: 0 2px 12px rgba(0, 212, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

textarea.input-glass {
    resize: vertical;
    min-height: 60px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 12px;
}

textarea.input-glass:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.05);
}

/* ===== FILE UPLOAD ===== */
.file-upload-wrapper {
    position: relative;
    display: inline-block;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

.file-upload-wrapper .file-label {
    display: inline-block;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 13px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-wrapper:hover .file-label {
    border-color: #00d4ff;
    color: #f1f5f9;
    background: rgba(0, 212, 255, 0.05);
}

/* ===== BUTTONS ===== */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.btn-primary-glass {
    background: linear-gradient(135deg, #00d4ff, #2563eb);
    color: #ffffff;
    border: none;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.15);
}

.btn-primary-glass:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 30px rgba(0, 212, 255, 0.25);
}

.btn-secondary-glass {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-secondary-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-success-glass {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.btn-success-glass:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 30px rgba(16, 185, 129, 0.25);
}

.btn-danger-glass {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-danger-glass:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-export-glass {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-export-glass:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.btn-remove-glass {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: none;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.btn-remove-glass:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* ===== SEARCH INPUT ===== */
.search-input {
    min-width: 160px;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    color: #f1f5f9;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.search-input:focus {
    border-color: #00d4ff;
    outline: none;
}

/* ===== RINGKASAN DATA ===== */
.data-summary {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.data-summary h3 {
    font-size: 13px;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 20px;
}

.summary-item {
    display: flex;
    font-size: 13px;
    padding: 2px 0;
    font-family: 'Inter', sans-serif;
}

.summary-label {
    font-weight: 500;
    min-width: 120px;
    color: #94a3b8;
}

.summary-value {
    color: #f1f5f9;
}

/* ===== SURAT CONTAINER ===== */
.surat-container {
    background: #ffffff;
    padding: 20px; /* Dikurangi dari 30px agar lebih muat */
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 400px;
    margin-bottom: 10px;
}

.surat-content {
    max-width: 100%;
    margin: 0 auto;
    font-size: 12pt;
    line-height: 1.6; /* Dikurangi dari 1.8 agar lebih kompak */
    color: #000000;
    background: #ffffff;
    font-family: 'Times New Roman', Times, serif;
}

/* ===== SURAT STYLES ===== */
.surat-body .surat-title {
    text-align: center;
    font-size: 14pt;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #000000;
    margin-bottom: 20px;
    padding-bottom: 0;
    border: none;
    text-decoration: none;
}

.surat-body p {
    margin-bottom: 6px;
    text-align: justify;
    font-size: 12pt;
    font-family: 'Times New Roman', Times, serif;
}

/* ===== TABEL DATA BORDERLESS (TITIK DUA SEJAJAR) ===== */
.surat-body .data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0;
}

.surat-body .data-table td {
    padding: 2px 0;
    border: none;
    font-size: 12pt;
    font-family: 'Times New Roman', Times, serif;
    vertical-align: top;
}

.surat-body .data-table .label-col {
    width: 160px;
    font-weight: normal;
    text-align: left;
    color: #000000;
}

.surat-body .data-table .colon-col {
    width: 15px;
    text-align: center;
    color: #000000;
    font-weight: normal;
}

.surat-body .data-table .value-col {
    text-align: left;
    color: #000000;
    padding-left: 5px;
}

.surat-body .mt-20 {
    margin-top: 12px;
}

.surat-body .kluster-center {
    text-align: center;
    font-weight: bold;
    font-size: 14pt;
    margin: 16px 0;
    padding: 8px;
    color: #000000;
    border: none;
    text-transform: uppercase;
    font-family: 'Times New Roman', Times, serif;
}

/* ===== SIGNATURE - RATA KIRI 300px ===== */
.surat-body .signature-section {
    margin-top: 25px;
    text-align: left;
    padding-left: 700px !important;
}

.surat-body .signature-item {
    font-size: 12pt;
    font-family: 'Times New Roman', Times, serif;
    margin: 2px 0;
    line-height: 1.5;
}

.surat-body .signature-item strong {
    font-weight: bold;
}

.surat-body .signature-spacer {
    height: 0.3em;
}

.surat-body .ttd-container {
    margin: 4px 0 4px 0;
    min-height: 70px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.surat-body #ttdPlaceholder {
    color: #999;
    font-style: italic;
    font-size: 12pt;
}

.surat-body #displayTtd {
    border: none;
    padding: 0;
    background: white;
    max-width: 150px;
    max-height: 80px;
}

/* ===== RIWAYAT ===== */
#riwayatList {
    display: none;
}

.riwayat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.riwayat-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.riwayat-item .info {
    flex: 1;
    min-width: 150px;
    cursor: pointer;
}

.riwayat-item .info .nama {
    font-weight: 600;
    color: #f1f5f9;
    font-size: 14px;
}

.riwayat-item .info .detail {
    font-size: 12px;
    color: #94a3b8;
}

.riwayat-item .actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    cursor: default;
}

.riwayat-item .actions button {
    padding: 4px 12px;
    border: none;
    border-radius: 50px;
    font-size: 12px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.riwayat-item .actions .btn-pdf {
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
}

.riwayat-item .actions .btn-pdf:hover {
    background: rgba(0, 212, 255, 0.25);
}

.riwayat-item .actions .btn-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.riwayat-item .actions .btn-delete:hover {
    background: rgba(239, 68, 68, 0.25);
}

.empty-state {
    text-align: center;
    color: #475569;
    padding: 40px;
    font-size: 14px;
}

.storage-info {
    margin-top: 15px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 12px;
    color: #64748b;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* ===== NOTIFICATION ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 24px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: notifSlide 0.4s ease;
    max-width: 90%;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes notifSlide {
    from { transform: translateX(60px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.success {
    background: rgba(16, 185, 129, 0.9);
}
.notification.error {
    background: rgba(239, 68, 68, 0.9);
}
.notification.info {
    background: rgba(0, 212, 255, 0.9);
}
.notification.warning {
    background: rgba(245, 158, 11, 0.9);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .layer-input {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .app-header {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }
    
    .card-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }
    
    .search-input {
        min-width: 120px;
        flex: 1;
    }
}

@media (max-width: 600px) {
    .splash-title {
        font-size: 36px;
        letter-spacing: 3px;
    }
    
    .splash-subtitle {
        font-size: 16px;
    }
    
    .splash-btn {
        padding: 12px 30px;
        font-size: 15px;
    }
    
    .app-container {
        padding: 10px 12px 30px;
    }
    
    .glass-card {
        padding: 15px;
    }
    
    .surat-container {
        padding: 12px;
    }
    
    .surat-body .data-table .label-col {
        width: auto;
        min-width: 100px;
    }
    
    .surat-body .signature-section {
        padding-left: 30px !important;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group button {
        width: 100%;
        justify-content: center;
    }
    
    .riwayat-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .riwayat-item .actions {
        justify-content: flex-start;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .card-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .search-input {
        min-width: 100%;
    }
    
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 13px;
        padding: 12px 16px;
    }
}

/* ===== PRINT ===== */
@media print {
    body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    #splashScreen { display: none !important; }
    .app-header { display: none !important; }
    .layer-input { display: none !important; }
    .layer-riwayat { display: none !important; }
    .data-summary { display: none !important; }
    .btn-group { display: none !important; }
    .notification { display: none !important; }
    
    .layer-hasil {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
    }
    
    .glass-card {
        background: white !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        padding: 0 !important;
    }
    
    .card-header { display: none !important; }
    
    .surat-container {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
    }
    
    .surat-content {
        font-size: 12pt !important;
        color: black !important;
        background: white !important;
        padding: 0 !important;
        font-family: 'Times New Roman', Times, serif !important;
    }
    
    .surat-title { font-size: 14pt !important; }
    
    .surat-body .kluster-center {
        font-size: 14pt !important;
        border: none !important;
        background: white !important;
        padding: 10px !important;
    }
    
    .surat-body .data-table td { border: none !important; }
    
    .surat-body .signature-section {
        padding-left: 300px !important;
    }
}