/* NusaBloom Etsy Data Hub — identiti teal, navy, krim dan jingga */
:root {
    --nb-navy: #10263B;
    --nb-navy-soft: #1B3A55;
    --nb-teal: #0F7A73;
    --nb-teal-dark: #0B5C57;
    --nb-cream: #FAF4E9;
    --nb-cream-deep: #F1E7D5;
    --nb-orange: #E2711D;
    --nb-ink: #17222E;
    --nb-muted: #64748B;
    --nb-line: #E3DED1;
    --nb-white: #FFFFFF;
    --nb-radius: 14px;
}

* { box-sizing: border-box; }

body {
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--nb-cream);
    color: var(--nb-ink);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

a { color: var(--nb-teal-dark); }
a:hover { color: var(--nb-teal); }

:focus-visible {
    outline: 3px solid var(--nb-orange);
    outline-offset: 2px;
}

.nb-muted { color: var(--nb-muted); }
.nb-nowrap { white-space: nowrap; }
.nb-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--nb-line); }

/* ---------- Rangka utama ---------- */
.nb-shell { display: flex; min-height: 100vh; }

.nb-sidebar {
    width: 262px;
    flex: 0 0 262px;
    background: var(--nb-navy);
    color: #D7E2EC;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.nb-sidebar-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nb-sidebar-head strong { display: block; color: #fff; font-size: 15px; }
.nb-sidebar-head small { color: #8FA9BF; font-size: 12px; }

.nb-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 12px;
    background: var(--nb-teal);
    color: #fff;
    font-weight: 700;
    letter-spacing: .5px;
}

.nb-sidebar-close {
    margin-left: auto;
    background: none; border: 0; color: #C7D6E2;
    font-size: 26px; line-height: 1;
}

.nb-nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.nb-nav-group {
    margin: 16px 10px 6px;
    font-size: 11.5px;
    letter-spacing: .04em;
    color: #7E97AC;
}
.nb-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    color: #D7E2EC;
    text-decoration: none;
    font-weight: 500;
}
.nb-nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nb-nav-link.active { background: var(--nb-teal); color: #fff; }
.nb-nav-soon { color: #7E97AC; cursor: default; }
.nb-nav-soon:hover { background: none; color: #7E97AC; }
.nb-soon {
    font-size: 10.5px;
    background: rgba(226, 113, 29, .18);
    color: #F0A868;
    padding: 2px 8px;
    border-radius: 999px;
}

.nb-sidebar-foot {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 12px;
    color: #7E97AC;
}
.nb-sidebar-foot p { margin: 0; }

.nb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.nb-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 26px;
    background: var(--nb-white);
    border-bottom: 1px solid var(--nb-line);
    position: sticky;
    top: 0;
    z-index: 20;
}
.nb-topbar-title h1 { font-size: 20px; font-weight: 700; margin: 0; }
.nb-topbar-title p { margin: 0; font-size: 13px; color: var(--nb-muted); }

.nb-burger { background: none; border: 0; padding: 6px; }
.nb-burger span {
    display: block; width: 22px; height: 2px;
    background: var(--nb-navy); margin: 4px 0; border-radius: 2px;
}

.nb-user { margin-left: auto; }
.nb-user-btn {
    display: flex; align-items: center; gap: 10px;
    background: none; border: 1px solid var(--nb-line);
    border-radius: 999px; padding: 6px 14px 6px 6px;
}
.nb-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--nb-navy); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.nb-user-meta { text-align: left; line-height: 1.2; }
.nb-user-meta strong { display: block; font-size: 13.5px; }
.nb-user-meta small { color: var(--nb-muted); font-size: 11.5px; }

.nb-content { padding: 26px; flex: 1; }
.nb-footer {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;
    padding: 16px 26px; font-size: 12.5px; color: var(--nb-muted);
    border-top: 1px solid var(--nb-line);
}

.nb-backdrop {
    position: fixed; inset: 0; background: rgba(16, 38, 59, .5); z-index: 30;
}

/* ---------- Kad dan komponen ---------- */
.nb-card {
    background: var(--nb-white);
    border: 1px solid var(--nb-line);
    border-radius: var(--nb-radius);
    padding: 22px;
}
.nb-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nb-card-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; }

.nb-badge-muted {
    font-size: 12px; color: var(--nb-muted);
    background: var(--nb-cream-deep); padding: 4px 12px; border-radius: 999px;
}

.nb-status {
    display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between;
    background: var(--nb-navy); color: #E6EEF5;
    border-radius: var(--nb-radius); padding: 24px; margin-bottom: 22px;
    border-left: 6px solid var(--nb-orange);
}
.nb-status.is-connected { border-left-color: var(--nb-teal); }
.nb-status h2 { font-size: 22px; margin: 2px 0 8px; color: #fff; }
.nb-status-label { font-size: 12px; color: #8FA9BF; margin: 0; }
.nb-status-text { font-size: 13.5px; color: #B9CBD9; margin: 0; max-width: 62ch; }
.nb-status-value { font-size: 17px; font-weight: 600; color: #fff; margin: 2px 0 4px; }
.nb-status-meta { min-width: 200px; }

.nb-stats { margin-top: 0; }
.nb-stat {
    background: var(--nb-white); border: 1px solid var(--nb-line);
    border-radius: var(--nb-radius); padding: 18px; height: 100%;
}
.nb-stat-label { font-size: 12.5px; color: var(--nb-muted); margin: 0 0 6px; }
.nb-stat-value { font-size: 24px; font-weight: 700; margin: 0; color: var(--nb-navy); }
.nb-stat-sub { font-size: 12.5px; color: var(--nb-muted); margin: 4px 0 0; }

.nb-empty {
    text-align: center; padding: 34px 18px;
    border: 1px dashed var(--nb-line); border-radius: 12px;
    background: var(--nb-cream);
}
.nb-empty h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.nb-empty p { margin: 0 auto; max-width: 52ch; color: var(--nb-muted); font-size: 13.5px; }
.nb-empty-sm { padding: 20px 12px; }

.nb-timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.nb-timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--nb-line); }
.nb-timeline li:last-child { border-bottom: 0; }
.nb-timeline-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--nb-teal); margin-top: 8px; flex: 0 0 9px;
}
.nb-timeline strong { font-size: 13px; }
.nb-timeline p { margin: 2px 0; font-size: 13px; }
.nb-timeline small { color: var(--nb-muted); font-size: 12px; }

.nb-next-item {
    background: var(--nb-cream); border-radius: 12px; padding: 16px; height: 100%;
    border: 1px solid var(--nb-line);
}
.nb-next-item strong { display: block; margin-bottom: 4px; }
.nb-next-item p { margin: 0; font-size: 13px; color: var(--nb-muted); }

.nb-table thead th {
    font-size: 12px; color: var(--nb-muted); font-weight: 600;
    border-bottom: 1px solid var(--nb-line);
}
.nb-table td { border-color: var(--nb-line); }
.nb-code { background: var(--nb-cream-deep); padding: 2px 8px; border-radius: 6px; color: var(--nb-navy); }

.nb-pill { font-size: 12px; padding: 3px 12px; border-radius: 999px; }
.nb-pill-on { background: rgba(15, 122, 115, .12); color: var(--nb-teal-dark); }
.nb-pill-off { background: rgba(100, 116, 139, .14); color: var(--nb-muted); }

.nb-row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.nb-dl { margin: 12px 0 0; }
.nb-dl dt { font-size: 12.5px; color: var(--nb-muted); font-weight: 500; }
.nb-dl dd { margin: 0 0 12px; font-weight: 600; }

.nb-pagination { display: flex; align-items: center; gap: 14px; margin-top: 16px; font-size: 13px; }

.nb-alert { border-radius: 12px; border: 0; font-size: 14px; }

.btn-nb-primary {
    background: var(--nb-teal); border-color: var(--nb-teal); color: #fff; font-weight: 600;
}
.btn-nb-primary:hover, .btn-nb-primary:focus {
    background: var(--nb-teal-dark); border-color: var(--nb-teal-dark); color: #fff;
}

/* ---------- Halaman log masuk ---------- */
.nb-auth-body { background: var(--nb-cream); }
.nb-auth-wrap { display: flex; min-height: 100vh; }

.nb-auth-brand {
    flex: 1 1 50%;
    background: linear-gradient(160deg, var(--nb-navy) 0%, var(--nb-teal-dark) 100%);
    color: #E6EEF5;
    display: flex; align-items: center; padding: 48px;
}
.nb-auth-brand-inner { max-width: 46ch; }
.nb-auth-brand h1 { font-size: 34px; font-weight: 700; color: #fff; margin: 20px 0 12px; }
.nb-auth-brand h1 span { color: var(--nb-orange); }
.nb-auth-brand p { color: #C3D3E0; }
.nb-auth-points { list-style: none; padding: 0; margin: 26px 0 0; }
.nb-auth-points li { padding: 8px 0 8px 22px; position: relative; font-size: 14px; color: #D4E1EB; }
.nb-auth-points li::before {
    content: ""; position: absolute; left: 0; top: 16px;
    width: 8px; height: 8px; border-radius: 50%; background: var(--nb-orange);
}

.nb-auth-form {
    flex: 1 1 50%;
    display: flex; flex-direction: column; justify-content: center;
    padding: 48px; max-width: 620px; margin: 0 auto; width: 100%;
}
.nb-login-card {
    background: var(--nb-white); border: 1px solid var(--nb-line);
    border-radius: var(--nb-radius); padding: 32px;
}
.nb-login-card h2 { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.nb-login-note { font-size: 12.5px; color: var(--nb-muted); margin: 20px 0 0; }

.nb-password { position: relative; }
.nb-password-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; font-size: 13px; color: var(--nb-teal-dark); font-weight: 600;
}

/* ---------- Halaman ralat ---------- */
.nb-blank-body {
    background: var(--nb-cream);
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    padding: 24px;
}
.nb-error { text-align: center; max-width: 46ch; }
.nb-error-code { font-size: 64px; font-weight: 700; color: var(--nb-teal); margin: 0; line-height: 1; }
.nb-error h1 { font-size: 24px; font-weight: 700; margin: 10px 0; }
.nb-error-msg { color: var(--nb-muted); }
.nb-error-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Responsif ---------- */
@media (max-width: 991.98px) {
    .nb-sidebar {
        position: fixed; left: 0; top: 0; z-index: 40;
        transform: translateX(-100%); transition: transform .2s ease;
    }
    .nb-sidebar.is-open { transform: translateX(0); }
    .nb-content { padding: 18px; }
    .nb-topbar { padding: 14px 18px; }
    .nb-auth-brand { display: none; }
    .nb-auth-form { padding: 28px 20px; }
}

@media (max-width: 575.98px) {
    .nb-status { padding: 18px; }
    .nb-status h2 { font-size: 19px; }
    .nb-user-meta { display: none; }
    .nb-login-card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------- Sambungan Etsy ---------- */
.nb-scope-list { list-style: none; padding: 0; margin: 14px 0 0; }
.nb-scope-list li {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--nb-line);
}
.nb-scope-list li:last-child { border-bottom: 0; }
.nb-scope-list strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--nb-teal-dark); }
.nb-scope-list span { color: var(--nb-muted); font-size: 13px; text-align: right; }
.nb-break { word-break: break-all; }
.nb-row-actions.justify-content-start { justify-content: flex-start; }
.nb-status-link { color: #F0A868; text-decoration: underline; font-weight: 600; }
.nb-status-link:hover { color: #fff; }

/* ---------- Penyelarasan ---------- */
.nb-sync-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.nb-note { font-size: 12.5px; color: var(--nb-muted); max-width: 40ch; }

/* ---------- Laporan dan webhook ---------- */
.nb-stat-accent { border-left: 4px solid var(--nb-teal); }
.nb-link-sm { font-size: 13px; font-weight: 600; color: var(--nb-teal-dark); text-decoration: none; }
.nb-link-sm:hover { text-decoration: underline; }
.nb-total-row th { border-top: 2px solid var(--nb-line); background: var(--nb-cream); }
/* Had saiz carta */
#nbSalesChart,
#nbMonthlyChart {
    display: block;
    width: 100% !important;
    height: 320px !important;
    max-height: 320px;
}

#nbProductChart {
    display: block;
    width: 100% !important;
    height: 280px !important;
    max-height: 280px;
}

@media (max-width: 575.98px) {
    #nbSalesChart,
    #nbMonthlyChart,
    #nbProductChart {
        height: 240px !important;
        max-height: 240px;
    }
}