:root {
    --bg-color: #F8F9FE;
    --primary: #7B2CBF;
    --primary-dark: #5a1e8f;
    --primary-light: #F3E8FF;
    --text-dark: #1F2937;
    --text-gray: #6B7280;
    --border-color: #E5E7EB;
    --success-bg: #DCFCE7;
    --success-text: #15803D;
    --warning-bg: #FFEDD5;
    --warning-text: #C2410C;
    --danger-bg: #FEE2E2;
    --danger-text: #B91C1C;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 24px rgba(123, 44, 191, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    /* padding-bottom: 40px; */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============ HEADER ============ */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    user-select: none;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon img {
    display: block;
    height: 32px;
    width: auto;
}

nav {
    display: flex;
    gap: 8px;
}

nav a {
    text-decoration: none;
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

nav a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

nav a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* ============ PAGE VIEWS ============ */
.page-view {
    display: none;
}

.page-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ HERO SECTION ============ */
.hero {
    background: linear-gradient(135deg, #FDF7FF 0%, #F3E8FF 100%);
    max-width: 1000px;
    margin: 24px auto 32px;
    /* Memberikan jarak dari atas dan bawah */
    padding: 60px 40px;
    text-align: center;
    border-radius: 24px;
    /* Sudut melengkung di semua sisi */
    /* box-shadow: var(--shadow-lg);  */
    position: relative;
    overflow: hidden;
    /* Memotong efek blur agar tetap di dalam card */
    transition: opacity 0.3s;
}

/* Efek background blur (seperti di desain) */
.hero::before {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 250px;
    height: 250px;
    background: rgba(255, 192, 203, 0.5);
    /* Warna pink pudar */
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 250px;
    height: 250px;
    background: rgba(216, 191, 216, 0.5);
    /* Warna ungu pudar */
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
}

.hero>* {
    position: relative;
    z-index: 1;
    /* Memastikan konten di atas efek blur */
}

.hero-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.hero h1 {
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.hero p {
    color: var(--text-gray);
    max-width: 520px;
    margin: 0 auto 24px;
    font-size: 15px;
    line-height: 1.6;
}

.search-box {
    display: flex;
    align-items: center;
    max-width: 520px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 6px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(123, 44, 191, 0.1);
    /* Border sangat tipis */
}

.search-box .fa-key {
    color: var(--text-gray);
    margin-left: 16px;
    font-size: 16px;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 8px;
    min-width: 0;
    color: var(--text-dark);
}

.search-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    white-space: nowrap;
}

.search-box button:hover {
    background: var(--primary-dark);
}

.search-box button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hero-note {
    font-size: 13px;
    color: var(--text-gray);
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.hero-note i {
    color: var(--text-gray);
    font-size: 14px;
}

.hero-note span {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.hero-note span:hover {
    text-decoration: underline;
}

/* ============ MAIN CONTAINER ============ */
.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

#dashboardContainer {
    display: none;
}

/* ============ GREETING CARD ============ */
.greeting-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.greeting-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 240px;
}

.greeting-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 20px;
    flex-shrink: 0;
}

.greeting-text h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.greeting-text p {
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.5;
}

.access-key-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* ============ SUMMARY CARDS ============ */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.summary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
}

.summary-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.summary-card h3 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    word-break: break-word;
}

.summary-card .sub-text {
    font-size: 12px;
    color: var(--text-gray);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* ============ PROGRESS BAR ============ */
.progress-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.progress-header h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar-bg {
    height: 10px;
    background: #F3F4F6;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #a855f7);
    border-radius: 5px;
    width: 0%;
    transition: width 0.8s ease;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-gray);
    gap: 12px;
    flex-wrap: wrap;
}

/* ============ TABLES ============ */
.table-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.table-header h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-header .order-id {
    font-size: 13px;
    color: var(--text-gray);
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 640px;
}

th {
    text-align: left;
    padding: 12px 16px;
    background: #F9FAFB;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #FAFAFB;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-title {
    font-weight: 600;
}

.product-format {
    font-size: 12px;
    color: var(--text-gray);
}

/* ============ SUPPORT SECTION ============ */
.support-section {
    background: var(--primary-light);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.support-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 240px;
}

.support-icon {
    width: 48px;
    height: 48px;
    background: #FDE68A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.support-text h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.support-text p {
    font-size: 13px;
    color: var(--text-gray);
    max-width: 480px;
    line-height: 1.5;
}

.btn-whatsapp {
    background: #F97316;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-whatsapp:hover {
    background: #ea580c;
}

.support-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    min-width: 250px;
}

.support-actions .btn-whatsapp {
    width: 100%;
    justify-content: center;
}

/* ============ FAQ & CONTACT VIEWS ============ */
.page-hero {
    background: linear-gradient(135deg, #FDF7FF 0%, #F3E8FF 100%);
    padding: 48px 20px 40px;
    text-align: center;
    border-radius: 0 0 24px 24px;
    margin-bottom: 32px;
}

.page-hero h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.page-hero p {
    color: var(--text-gray);
    max-width: 520px;
    margin: 0 auto;
    font-size: 15px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.faq-item {
    background: white;
    border-radius: 12px;
    padding: 4px 4px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.faq-question {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    user-select: none;
}

.faq-question .chevron {
    color: var(--primary);
    font-size: 18px;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.faq-item.open .faq-question .chevron {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 20px;
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.7;
}

.faq-item.open .faq-answer {
    max-height: 400px;
    padding: 0 20px 18px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
}

.contact-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.contact-card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.contact-card h4 {
    font-size: 16px;
    margin-bottom: 6px;
}

.contact-card p {
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.5;
}

.contact-card .contact-value {
    margin-top: 12px;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

/* ============ FOOTER ============ */
footer {
    margin-top: auto;
    width: 100%;
    background: white;
    border-top: 1px solid var(--border-color);
}

.footer-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-gray);
    gap: 12px;
    flex-wrap: wrap;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-grid .summary-card:nth-child(3) {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    header {
        padding: 14px 20px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }

    .logo {
        justify-content: center;
        font-size: 20px;
    }

    nav {
        width: 100%;
        justify-content: center;
        overflow-x: auto;
        padding-bottom: 4px;
        gap: 4px; 
    }

    nav a {
        padding: 8px 12px;
        font-size: 13px;
        text-align: center;
    }

    nav a i {
        display: none;
    }

    .hero {
        margin: 16px auto;
        width: calc(100% - 40px);
        padding: 40px 20px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .hero p {
        font-size: 14px;
    }

    .search-box {
        flex-direction: column;
        padding: 8px;
        gap: 8px;
    }

    .search-box input {
        padding: 12px;
        text-align: center;
    }

    .search-box button {
        justify-content: center;
        padding: 14px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid .summary-card:nth-child(3) {
        grid-column: span 1;
    }

    .greeting-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .access-key-badge {
        align-self: flex-start;
    }

    .support-section {
        flex-direction: column;
        /* text-align: left; */
        align-items: stretch;
    }

    .support-left {
        flex-direction: row;
    }

    .support-actions {
        width: 100%;
        min-width: 0;
    }

    .btn-whatsapp {
        width: 100%;
        justify-content: center;
    }

    .table-section {
        padding: 20px 16px;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-labels {
        font-size: 12px;
    }

    .page-hero {
        padding: 36px 20px 32px;
    }

    .page-hero h1 {
        font-size: 22px;
    }

    .footer-inner {
        padding: 16px 20px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .summary-card h3 {
        font-size: 22px;
    }

    .greeting-text h2 {
        font-size: 17px;
    }

    th,
    td {
        padding: 12px;
    }

    .access-key-badge {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty state */
.empty-row td {
    text-align: center;
    color: var(--text-gray);
    padding: 32px 16px;
    font-style: italic;
}