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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f0ff 0%, #ede9fe 50%, #faf5ff 100%);
    min-height: 100vh;
    padding: 1rem;
    color: #1e1b2e;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   HEADER
   ============================================ */
.header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    padding: 0.7rem 1.5rem;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(106, 27, 154, 0.08);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(233, 216, 253, 0.7);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon {
    font-size: 1.8rem;
}

.brand h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #4a1d6e;
}

.brand .sub {
    font-size: 0.7rem;
    color: #6d4c8a;
    display: block;
    margin-top: -2px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #f1e9fc;
    padding: 0.3rem 0.8rem 0.3rem 0.5rem;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.8rem;
    color: #3b1d5c;
}

.user-badge .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #6a1b9a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

.btn-modern {
    padding: 0.35rem 0.9rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-primary {
    background: #6a1b9a;
    color: #fff;
}
.btn-primary:hover {
    background: #7b2fbe;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(106, 27, 154, 0.25);
}

.btn-purple {
    background: #8e24aa;
    color: #fff;
}
.btn-purple:hover {
    background: #a834c4;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(142, 36, 170, 0.25);
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}
.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* ============================================
   HERO
   ============================================ */
.hero-modern {
    text-align: center;
    padding: 1.5rem 0.5rem 1.2rem;
    background: linear-gradient(145deg, #ffffff, #f5f0ff);
    border-radius: 32px;
    margin-bottom: 1.5rem;
    box-shadow: 0 12px 40px rgba(106, 27, 154, 0.06);
    border: 1px solid rgba(233, 216, 253, 0.8);
}

.hero-modern h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #4a1d6e;
    letter-spacing: -0.5px;
}

.hero-modern p {
    color: #6d4c8a;
    font-size: 1rem;
    margin-top: 0.2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.pill-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}

.pill {
    background: #f1e9fc;
    padding: 0.25rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.75rem;
    color: #5e2e8a;
}

.pill.active {
    background: #6a1b9a;
    color: #fff;
    box-shadow: 0 4px 12px rgba(106, 27, 154, 0.25);
}

/* ============================================
   STEP CARD
   ============================================ */
.step-card {
    background: #ffffff;
    border-radius: 28px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(106, 27, 154, 0.06);
    border: 1px solid #f1e9fc;
}

.step-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: #4a1d6e;
    margin-bottom: 1.2rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    flex-shrink: 0;
    background: #6a1b9a;
    color: #fff;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
}

.step-title small {
    font-weight: 400;
    color: #9075b8;
    font-size: 0.8rem;
    margin-left: 0.2rem;
}

/* ============================================
   FORM
   ============================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #5e2e8a;
}

.form-group select,
.form-group input {
    padding: 0.6rem 0.8rem;
    border: 2px solid #e9d8fd;
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    background: #faf7ff;
    transition: 0.2s;
    color: #1e1b2e;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236a1b9a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 10px;
}

.form-group input {
    appearance: none;
    background-image: none;
}

.form-group select:focus,
.form-group input:focus {
    border-color: #6a1b9a;
    outline: none;
    box-shadow: 0 0 0 4px rgba(106, 27, 154, 0.1);
    background-color: #fff;
}

.btn-simulasi {
    background: linear-gradient(145deg, #6a1b9a, #8e24aa);
    color: #fff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 16px rgba(106, 27, 154, 0.2);
}

.btn-simulasi:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(106, 27, 154, 0.3);
    background: linear-gradient(145deg, #7b2fbe, #9c27b0);
}

/* ============================================
   RESULT
   ============================================ */
.result-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid #f1e9fc;
    margin-top: 0.5rem;
}

.result-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #9075b8;
}

.result-empty .icon-big {
    font-size: 2.5rem;
    margin-bottom: 0.3rem;
    opacity: 0.6;
}

.result-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.8rem;
    border-radius: 12px;
    text-align: center;
    font-size: 0.9rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.2rem;
}

.result-item {
    text-align: center;
}

.result-item .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #9075b8;
    font-weight: 600;
}

.result-item .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4a1d6e;
    margin-top: 0.1rem;
}

.result-item .value.angsuran {
    font-size: 1.8rem;
    color: #4a1d6e;
    background: linear-gradient(145deg, #6a1b9a, #8e24aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-item .value.angsuran::before {
    content: 'Rp ';
    font-size: 0.9rem;
    font-weight: 600;
    -webkit-text-fill-color: #9075b8;
}

/* ============================================
   FOOTER
   ============================================ */
.footer-modern {
    margin-top: 2rem;
    text-align: center;
    color: #9075b8;
    font-size: 0.75rem;
    border-top: 1px solid #e9d8fd;
    padding-top: 1rem;
}

/* ============================================
   LOGIN, UPLOAD, APPROVE – Halaman tengah
   ============================================ */
.login-page,
.upload-page,
.approve-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card,
.upload-card,
.approve-card {
    background: #fff;
    border-radius: 28px;
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 12px 40px rgba(106, 27, 154, 0.08);
    border: 1px solid #f1e9fc;
}

.login-card h1,
.upload-card h1,
.approve-card h1 {
    font-size: 1.8rem;
    color: #4a1d6e;
    margin-bottom: 0.2rem;
    text-align: center;
}

.login-card .sub,
.upload-card .subtitle {
    color: #9075b8;
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-card .error {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.6rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    text-align: center;
}

.btn-login {
    width: 100%;
    background: linear-gradient(145deg, #6a1b9a, #8e24aa);
    color: white;
    border: none;
    padding: 0.7rem;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(106, 27, 154, 0.3);
}

/* ============================================
   APPROVE TABLE (Responsif)
   ============================================ */
.approve-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.approve-header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.btn-kembali {
    background: #f1e9fc;
    color: #6a1b9a;
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
    transition: 0.2s;
}

.btn-kembali:hover {
    background: #e9d8fd;
    transform: translateY(-2px);
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border-radius: 12px;
    border: 1px solid #f1e9fc;
}

.approve-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.approve-table th {
    background: #6a1b9a;
    color: white;
    padding: 0.7rem 1rem;
    text-align: left;
    white-space: nowrap;
}

.approve-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #e9d8fd;
    color: #1e1b2e;
    white-space: nowrap;
}

.approve-table tr:hover td {
    background: #faf7ff;
}

.approve-table .btn-approve {
    background: #6a1b9a;
    color: white;
    border: none;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
}

.approve-table .btn-approve:hover {
    background: #7b2fbe;
    box-shadow: 0 4px 12px rgba(106, 27, 154, 0.3);
}

.empty-message {
    text-align: center;
    padding: 1.5rem;
    color: #9075b8;
    font-style: italic;
}

/* ============================================
   UPLOAD PAGE (khusus)
   ============================================ */
.upload-area {
    border: 2px dashed #d8b4fe;
    border-radius: 16px;
    padding: 2rem 1rem;
    background: #faf7ff;
    margin: 1.5rem 0;
    transition: 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #6a1b9a;
    background: #f1e9fc;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-label {
    cursor: pointer;
    color: #6a1b9a;
    font-weight: 600;
    display: block;
}

.btn-upload {
    background: linear-gradient(145deg, #6a1b9a, #8e24aa);
    color: white;
    border: none;
    padding: 0.7rem 2rem;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-upload:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(106, 27, 154, 0.3);
    background: linear-gradient(145deg, #7b2fbe, #9c27b0);
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    padding: 0.7rem;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
    text-align: center;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.7rem;
    border-radius: 12px;
    border: 1px solid #fecaca;
    text-align: center;
    margin-bottom: 1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    body {
        padding: 0.5rem;
    }
    .header-modern {
        flex-direction: column;
        align-items: stretch;
        padding: 0.8rem;
    }
    .brand h1 {
        font-size: 1.2rem;
    }
    .user-actions {
        justify-content: flex-end;
    }
    .hero-modern h2 {
        font-size: 1.6rem;
    }
    .step-card {
        padding: 1rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .result-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    .result-item .value.angsuran {
        font-size: 1.5rem;
    }
    .btn-simulasi {
        height: 44px;
        font-size: 0.85rem;
    }
    .login-card,
    .upload-card,
    .approve-card {
        padding: 1.5rem;
    }
    .approve-table {
        font-size: 0.8rem;
        min-width: 400px;
    }
    .approve-table th,
    .approve-table td {
        padding: 0.5rem 0.7rem;
    }
}

@media (max-width: 480px) {
    .brand h1 {
        font-size: 1rem;
    }
    .brand-icon {
        font-size: 1.4rem;
    }
    .user-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    .btn-modern {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
    }
    .result-item .value {
        font-size: 1rem;
    }
    .result-item .value.angsuran {
        font-size: 1.3rem;
    }
    .approve-table {
        font-size: 0.7rem;
        min-width: 320px;
    }
    .approve-table th,
    .approve-table td {
        padding: 0.4rem 0.5rem;
    }
    .approve-table .btn-approve {
        font-size: 0.65rem;
        padding: 0.2rem 0.6rem;
    }
}