/* ============================================================
   BERTAPI PANEL — MASTER STYLESHEET
   File: app.css
   ============================================================ */

/* ============================================================
   1. ROOT VARIABLES
   ============================================================ */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --text-light: #f1f5f9;
    --bg-light: #f1f5f9;
    --card-bg: #ffffff;
    --border-radius: 14px;
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
    --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    --header-height: 56px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: #1e293b;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
    min-height: 100vh;
}

.hidden-ui { display: none !important; }

/* ============================================================
   3. ACCESS DENIED OVERLAY
   ============================================================ */
#accessDenied {
    display: none; position: fixed; inset: 0;
    background: #f8fafc; z-index: 9999;
    flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 20px;
}
#accessDenied.show { display: flex; }
#accessDenied i { font-size: 5rem; color: #dc2626; margin-bottom: 20px; }
#accessDenied h3 { font-weight: 600; color: #1e293b; margin-bottom: 8px; }
#accessDenied p { color: #64748b; font-size: 1rem; }

/* ============================================================
   4. HEADER
   ============================================================ */
.app-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    display: flex; align-items: center; padding: 0 12px;
    z-index: 1000; border-bottom: 1px solid #e2e8f0;
}
.btn-menu {
    background: none; border: none; font-size: 1.5rem;
    color: #334155; cursor: pointer; padding: 8px; margin-right: 8px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; transition: background 0.2s;
}
.btn-menu:active { background: #e2e8f0; }
.app-brand {
    font-weight: 700; font-size: 1.1rem; color: #1e293b;
    display: flex; align-items: center; gap: 8px; flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-brand i { color: var(--primary); }
.user-badge {
    display: flex; align-items: center; gap: 6px;
    background: #f1f5f9; padding: 6px 12px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 500; color: #334155;
    max-width: 40vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-badge i { color: var(--primary); }

/* ============================================================
   5. SIDEBAR
   ============================================================ */
.sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 1090; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
.app-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px;
    background: var(--sidebar-bg); z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex; flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
}
.app-sidebar.open { transform: translateX(0); }
.sidebar-header {
    padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 10px;
    color: white; font-weight: 600; font-size: 1.1rem;
}
.sidebar-header i { font-size: 1.4rem; color: #60a5fa; }
.sidebar-menu {
    list-style: none; padding: 12px 10px; flex: 1;
    overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
.sidebar-menu a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; color: #cbd5e1; text-decoration: none;
    border-radius: 10px; font-weight: 500;
    transition: background 0.2s, color 0.2s;
    cursor: pointer; white-space: nowrap;
}
.sidebar-menu a i {
    width: 22px; text-align: center; font-size: 1.1rem; flex-shrink: 0;
}
.sidebar-menu a.active {
    background: var(--primary); color: white;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.sidebar-menu a:not(.active):hover {
    background: var(--sidebar-hover); color: white;
}

/* ============================================================
   6. CONTENT
   ============================================================ */
.app-content {
    padding-top: calc(var(--header-height) + 16px);
    padding-left: 12px; padding-right: 12px;
    padding-bottom: 30px;
    max-width: 600px; margin: 0 auto; width: 100%;
}
.page-title {
    font-size: 1.4rem; font-weight: 700;
    color: #0f172a; margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}
.page-title i { color: var(--primary); }

/* ============================================================
   7. CARD
   ============================================================ */
.card-custom {
    background: var(--card-bg); border-radius: var(--border-radius);
    box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
    animation: fadeInUp 0.4s ease;
}
.card-title {
    font-weight: 600; color: #334155; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.info-item { display: flex; flex-direction: column; margin-bottom: 14px; }
.info-label {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
    color: #64748b; margin-bottom: 4px;
}
.info-value {
    font-weight: 600; color: #0f172a; font-size: 0.95rem; word-break: break-word;
}

/* ============================================================
   8. TOKEN BOX
   ============================================================ */
.token-box {
    background: #f8fafc; border: 1px dashed #cbd5e1;
    border-radius: 12px; padding: 12px;
}
.token-display {
    background: white; border-radius: 8px; padding: 12px 10px;
    font-family: 'Courier New', monospace; font-size: 0.95rem;
    color: #1e293b; text-align: center; letter-spacing: 1px;
    word-break: break-all; margin-bottom: 12px;
    border: 1px solid #e2e8f0;
}
.token-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.token-actions .btn {
    flex: 1; min-width: 80px; border-radius: 8px; font-weight: 500;
    display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 0.5rem; font-size: 0.85rem;
}

/* ============================================================
   9. CODE BLOCK (Kredensial)
   ============================================================ */
.code-block-wrapper { position: relative; margin: 12px 0; }
.code-block {
    background: #1e293b; color: #e2e8f0; border-radius: 10px;
    padding: 15px; font-family: 'Courier New', monospace;
    font-size: 0.55rem; overflow-x: auto; white-space: wrap;
    word-break: break-all; line-height: 1.5; margin: 0;
}
.btn-copy-code {
    position: absolute; top: 10px; right: 10px;
    background: rgba(255,255,255,0.2); border: none; color: white;
    border-radius: 6px; padding: 4px 10px; font-size: 0.75rem;
    display: flex; align-items: center; gap: 5px; cursor: pointer;
    transition: background 0.2s;
}
.btn-copy-code:hover { background: rgba(255,255,255,0.3); }

/* ============================================================
   10. COMING SOON ICON
   ============================================================ */
.coming-soon-icon {
    font-size: 4rem; color: #94a3b8;
    animation: float 3s ease-in-out infinite; margin-bottom: 20px;
}

/* ============================================================
   11. ANIMATIONS
   ============================================================ */
@keyframes float {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ============================================================
   12. RESPONSIVE — TABLET / DESKTOP
   ============================================================ */
@media (min-width: 768px) {
    .app-content { max-width: 800px; padding-left: 20px; padding-right: 20px; }
    .token-actions .btn { flex: initial; }
}

/* ============================================================
   13. CALLBACK CONFIG
   ============================================================ */
.callback-input-group { margin-bottom: 20px; }
.callback-input-group label {
    font-weight: 500; color: #334155; margin-bottom: 6px;
}
.callback-input-group input {
    border-radius: 8px; border: 1px solid #e2e8f0;
    padding: 10px 12px; width: 100%; font-size: 0.95rem;
    transition: border-color 0.2s;
}
.callback-input-group input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.btn-save-callback {
    width: 100%; border-radius: 8px; font-weight: 600; padding: 12px;
}

/* ============================================================
   14. NOTIFICATION
   ============================================================ */
#notification {
    position: fixed; top: 70px; right: 16px; z-index: 10000;
    min-width: 240px; max-width: 360px; padding: 14px 18px;
    border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    font-weight: 500; color: white; opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none; font-size: 0.95rem;
    display: flex; align-items: center; gap: 10px;
    background: #1e293b; border-left: 4px solid #4ade80;
}
#notification.show {
    opacity: 1; transform: translateY(0); pointer-events: auto;
}
#notification.success { background: #0f172a; border-left-color: #4ade80; }
#notification.error   { background: #0f172a; border-left-color: #f87171; }
#notification i { font-size: 1.2rem; }
#notification .notif-close {
    margin-left: auto; background: none; border: none;
    color: rgba(255,255,255,0.6); cursor: pointer;
    padding: 0 4px; font-size: 1rem; transition: color 0.2s;
}
#notification .notif-close:hover { color: white; }

/* ============================================================
   15. PRODUK BERT
   ============================================================ */
.produk-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.produk-stat-card {
    background: white;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--primary);
    transition: transform 0.2s;
    min-width: 0;
}
.produk-stat-card:active { transform: scale(0.97); }
.produk-stat-card .stat-num {
    font-size: 1.3rem; font-weight: 700; color: #0f172a;
    line-height: 1;
}
.produk-stat-card .stat-label {
    font-size: 0.62rem; font-weight: 600; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.3px;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.produk-stat-card.jxl  { border-top-color: #2563eb; }
.produk-stat-card.xbl  { border-top-color: #f59e0b; }
.produk-stat-card.khfy { border-top-color: #10b981; }

.produk-tabs {
    display: flex;
    gap: 6px;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.produk-tabs::-webkit-scrollbar { display: none; }
.produk-tab {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 9px;
    cursor: pointer;
    border: none;
    background: transparent;
    white-space: nowrap;
    transition: var(--transition);
}
.produk-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.produk-tab:active { transform: scale(0.96); }

.produk-search-wrap { position: relative; margin-bottom: 10px; }
.produk-search-wrap i.fa-search {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8; font-size: 0.9rem; pointer-events: none;
}
.produk-search {
    width: 100%; border: 1px solid #e2e8f0;
    border-radius: 10px; padding: 10px 12px 10px 38px;
    font-size: 0.9rem; background: white; transition: var(--transition);
}
.produk-search:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.produk-filter-row { display: flex; gap: 8px; margin-bottom: 16px; }
.produk-filter-row select {
    flex: 1; border: 1px solid #e2e8f0;
    border-radius: 10px; padding: 9px 12px;
    font-size: 0.85rem; background: white;
    color: #334155; cursor: pointer;
}
.produk-filter-row select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.btn-refresh {
    border: 1px solid #e2e8f0; background: white;
    border-radius: 10px; padding: 0 14px;
    color: var(--primary); font-size: 0.95rem;
    cursor: pointer; transition: var(--transition);
}
.btn-refresh:active { transform: scale(0.95); }
.btn-refresh.loading i { animation: spin 0.8s linear infinite; }

.produk-list { display: flex; flex-direction: column; gap: 10px; }
.produk-item {
    background: white; border-radius: 12px; padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary);
    transition: transform 0.15s, box-shadow 0.2s;
    animation: fadeInUp 0.3s ease;
}
.produk-item:active {
    transform: scale(0.985);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.produk-item.src-jxl  { border-left-color: #2563eb; }
.produk-item.src-xbl  { border-left-color: #f59e0b; }
.produk-item.src-khfy { border-left-color: #10b981; }

.produk-item-head {
    display: flex; justify-content: space-between;
    align-items: flex-start; gap: 8px; margin-bottom: 6px;
}
.produk-item-name {
    font-weight: 600; font-size: 0.95rem;
    color: #0f172a; line-height: 1.3; flex: 1;
}
.produk-source-badge {
    font-size: 0.6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.3px;
    padding: 3px 8px; border-radius: 20px;
    white-space: nowrap; flex-shrink: 0;
}
.produk-source-badge.jxl  { background: #dbeafe; color: #1e40af; }
.produk-source-badge.xbl  { background: #fef3c7; color: #92400e; }
.produk-source-badge.khfy { background: #d1fae5; color: #065f46; }

.produk-item-kode {
    font-family: 'Courier New', monospace; font-size: 0.75rem;
    color: #64748b; background: #f8fafc;
    padding: 3px 8px; border-radius: 6px;
    display: inline-flex; align-items: center; gap: 5px;
    margin-bottom: 8px; cursor: pointer;
    transition: background 0.2s; border: 1px solid #e2e8f0;
}
.produk-item-kode:active { background: #e2e8f0; }
.produk-item-kode i { font-size: 0.7rem; color: #94a3b8; }

.produk-item-meta {
    display: flex; flex-wrap: wrap;
    gap: 6px; margin-bottom: 8px;
}
.produk-tag {
    font-size: 0.7rem; font-weight: 500;
    padding: 3px 8px; border-radius: 6px;
    background: #f1f5f9; color: #475569;
    display: inline-flex; align-items: center; gap: 4px;
}
.produk-tag.open-yes { background: #d1fae5; color: #065f46; }
.produk-tag.open-no  { background: #fee2e2; color: #991b1b; }

.produk-item-desc {
    font-size: 0.78rem; color: #64748b;
    line-height: 1.45; margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.produk-item-foot {
    display: flex; justify-content: space-between;
    align-items: center; border-top: 1px dashed #e2e8f0;
    padding-top: 10px; gap: 8px;
}
.produk-harga {
    font-weight: 700; color: #059669;
    font-size: 1rem; line-height: 1.2;
}
.produk-harga small {
    display: block; font-size: 0.65rem;
    font-weight: 500; color: #94a3b8;
    text-transform: uppercase;
}
.btn-detail {
    background: var(--primary); color: white;
    border: none; border-radius: 8px;
    padding: 6px 14px; font-size: 0.78rem;
    font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px;
    transition: var(--transition);
}
.btn-detail:active {
    transform: scale(0.95);
    background: var(--primary-dark);
}

.produk-empty, .produk-loading {
    text-align: center; padding: 40px 20px;
    background: white; border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.produk-empty i { font-size: 3.5rem; color: #cbd5e1; margin-bottom: 15px; }
.produk-empty h6 { font-weight: 600; color: #475569; margin-bottom: 4px; }
.produk-empty p { font-size: 0.85rem; color: #94a3b8; margin: 0; }

.produk-loading .spinner {
    width: 40px; height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}
.produk-loading p { font-size: 0.85rem; color: #64748b; margin: 0; }

/* ============================================================
   16. DETAIL MODAL ROWS
   ============================================================ */
.produk-detail-row {
    display: flex; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem; gap: 12px;
}
.produk-detail-row:last-child { border-bottom: none; }
.produk-detail-row .label {
    color: #64748b; font-weight: 500;
    flex-shrink: 0; min-width: 90px;
}
.produk-detail-row .value {
    color: #0f172a; font-weight: 600;
    text-align: right; word-break: break-word;
}

/* ============================================================
   17. RIWAYAT API
   ============================================================ */
.riwayat-hero {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-radius: var(--border-radius);
    padding: 20px;
    color: white;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(37,99,235,0.25);
    position: relative;
    overflow: hidden;
}
.riwayat-hero::before {
    content: ''; position: absolute;
    right: -30px; top: -30px; width: 120px; height: 120px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.riwayat-hero::after {
    content: ''; position: absolute;
    right: 30px; bottom: -40px; width: 80px; height: 80px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.riwayat-hero-head {
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
    position: relative; z-index: 1;
    margin-bottom: 14px;
}
.riwayat-hero-title {
    font-size: 1.05rem; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}
.riwayat-hero-title i { font-size: 1.2rem; }
.riwayat-hero-sub {
    font-size: 0.78rem; opacity: 0.85;
    position: relative; z-index: 1;
    margin-bottom: 14px;
}
.riwayat-hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px; position: relative; z-index: 1;
}
.riwayat-hero-stat {
    background: rgba(255,255,255,0.12);
    border-radius: 10px; padding: 10px 4px;
    text-align: center;
    backdrop-filter: blur(4px);
}
.riwayat-hero-stat .num {
    font-size: 1.15rem; font-weight: 700;
    line-height: 1;
}
.riwayat-hero-stat .lbl {
    font-size: 0.58rem; opacity: 0.85;
    text-transform: uppercase; letter-spacing: 0.4px;
    margin-top: 5px; font-weight: 600;
}
.riwayat-hero-stat.total  .num { color: #ffffff; }
.riwayat-hero-stat.ok     .num { color: #86efac; }
.riwayat-hero-stat.bad    .num { color: #fca5a5; }
.riwayat-hero-stat.proses .num { color: #fde047; }

/* Status chips */
.riwayat-status-chips {
    display: flex; gap: 6px;
    overflow-x: auto; scrollbar-width: none;
    margin-bottom: 12px;
    padding-bottom: 2px;
}
.riwayat-status-chips::-webkit-scrollbar { display: none; }
.status-chip {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.status-chip:active { transform: scale(0.95); }
.status-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.status-chip .dot {
    width: 6px; height: 6px;
    border-radius: 50%; background: currentColor;
    opacity: 0.6;
}
.status-chip.active .dot { opacity: 1; }

/* Date range row */
.riwayat-date-row {
    display: flex; gap: 8px;
    margin-bottom: 12px;
}
.riwayat-date-row input[type="date"] {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.8rem;
    background: white;
    color: #334155;
    min-width: 0;
    transition: var(--transition);
}
.riwayat-date-row input[type="date"]:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.riwayat-date-row .btn-clear-date {
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 10px;
    padding: 0 12px;
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}
.riwayat-date-row .btn-clear-date:active { transform: scale(0.95); }

/* List */
.riwayat-list {
    display: flex; flex-direction: column;
    gap: 10px;
}
.riwayat-item {
    background: white; border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid #94a3b8;
    transition: var(--transition);
    cursor: pointer;
    animation: fadeInUp 0.3s ease;
}
.riwayat-item:active {
    transform: scale(0.985);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.riwayat-item.status-sukses  { border-left-color: #10b981; }
.riwayat-item.status-gagal   { border-left-color: #ef4444; }
.riwayat-item.status-proses  { border-left-color: #f59e0b; }
.riwayat-item.status-lain    { border-left-color: #94a3b8; }

.riwayat-item-head {
    display: flex; justify-content: space-between;
    align-items: flex-start; gap: 8px;
    margin-bottom: 8px;
}
.riwayat-item-produk {
    font-weight: 600; font-size: 0.9rem;
    color: #0f172a; line-height: 1.3;
    flex: 1; min-width: 0;
    word-break: break-word;
}
.riwayat-item-produk small {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    margin-top: 2px;
}

.riwayat-badges {
    display: flex; flex-direction: column;
    align-items: flex-end; gap: 4px;
    flex-shrink: 0;
}
.riwayat-sumber-badge,
.riwayat-status-badge {
    font-size: 0.6rem; font-weight: 700;
    padding: 3px 8px; border-radius: 20px;
    text-transform: uppercase; letter-spacing: 0.3px;
    white-space: nowrap;
    display: inline-flex; align-items: center; gap: 4px;
}
.riwayat-sumber-badge.blue   { background: #dbeafe; color: #1e40af; }
.riwayat-sumber-badge.purple { background: #ede9fe; color: #5b21b6; }
.riwayat-sumber-badge.gray   { background: #f1f5f9; color: #475569; }

.riwayat-status-badge.success { background: #d1fae5; color: #065f46; }
.riwayat-status-badge.danger  { background: #fee2e2; color: #991b1b; }
.riwayat-status-badge.warning { background: #fef3c7; color: #92400e; }
.riwayat-status-badge.info    { background: #cffafe; color: #155e75; }
.riwayat-status-badge.secondary { background: #f1f5f9; color: #475569; }

.riwayat-item-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    margin-bottom: 8px;
    padding: 8px 0;
    border-top: 1px dashed #e2e8f0;
    border-bottom: 1px dashed #e2e8f0;
}
.riwayat-meta-cell { min-width: 0; }
.riwayat-meta-cell .lbl {
    font-size: 0.6rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}
.riwayat-meta-cell .val {
    font-size: 0.78rem;
    color: #0f172a;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Courier New', monospace;
}
.riwayat-meta-cell .val.phone {
    font-family: 'Inter', sans-serif;
    color: #2563eb;
}
.riwayat-meta-cell .val.ref {
    font-family: 'Courier New', monospace;
    color: #475569;
    font-size: 0.72rem;
}

.riwayat-item-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.riwayat-item-harga {
    font-weight: 700;
    color: #059669;
    font-size: 0.95rem;
}
.riwayat-item-harga small {
    display: block;
    font-size: 0.6rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 1px;
}
.riwayat-item-waktu {
    font-size: 0.72rem;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.riwayat-item-waktu i { font-size: 0.7rem; }

.riwayat-item-ket {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.4;
    background: #f8fafc;
    color: #475569;
    border-left: 3px solid #cbd5e1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.riwayat-item-ket.warn  { border-left-color: #f59e0b; background: #fffbeb; color: #78350f; }
.riwayat-item-ket.err   { border-left-color: #ef4444; background: #fef2f2; color: #7f1d1d; }
.riwayat-item-ket.ok    { border-left-color: #10b981; background: #f0fdf4; color: #064e3b; }

/* Load more */
.riwayat-load-more-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 10px;
}
.btn-load-more {
    background: white;
    border: 1px solid #e2e8f0;
    color: var(--primary);
    border-radius: 10px;
    padding: 10px 24px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.btn-load-more:active {
    transform: scale(0.97);
    background: #f1f5f9;
}
.btn-load-more:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-load-more.loading i { animation: spin 0.8s linear infinite; }
.riwayat-load-info {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Modal detail riwayat */
.riwayat-detail-section { margin-bottom: 16px; }
.riwayat-detail-section:last-child { margin-bottom: 0; }
.riwayat-detail-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.riwayat-detail-section-title i { font-size: 0.75rem; }
.riwayat-detail-ket {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #334155;
    border-left: 3px solid #cbd5e1;
    word-break: break-word;
}
.riwayat-detail-ket.warn { border-left-color: #f59e0b; background: #fffbeb; color: #78350f; }
.riwayat-detail-ket.err  { border-left-color: #ef4444; background: #fef2f2; color: #7f1d1d; }
.riwayat-detail-ket.ok   { border-left-color: #10b981; background: #f0fdf4; color: #064e3b; }

.riwayat-sn-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.riwayat-sn-box .sn-val {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    color: #065f46;
    word-break: break-all;
}
.riwayat-sn-box .btn-copy-sn {
    background: white;
    border: 1px solid #86efac;
    color: #065f46;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    transition: var(--transition);
}
.riwayat-sn-box .btn-copy-sn:active { transform: scale(0.95); }

.riwayat-refund-box {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid #cbd5e1;
}
.riwayat-refund-box.success { background: #f0fdf4; border-left-color: #10b981; }
.riwayat-refund-box.warning { background: #fffbeb; border-left-color: #f59e0b; }
.riwayat-refund-box.info    { background: #eff6ff; border-left-color: #3b82f6; }
.riwayat-refund-box.danger  { background: #fef2f2; border-left-color: #ef4444; }
.riwayat-refund-box i { font-size: 1.2rem; flex-shrink: 0; }
.riwayat-refund-box.success i { color: #10b981; }
.riwayat-refund-box.warning i { color: #f59e0b; }
.riwayat-refund-box.info    i { color: #3b82f6; }
.riwayat-refund-box.danger  i { color: #ef4444; }
.riwayat-refund-box .txt {
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
}

/* ============================================================
   18. DOKUMENTASI
   ============================================================ */
.docs-tabs {
    display: flex; gap: 6px;
    background: #e2e8f0; padding: 4px;
    border-radius: 12px; margin-bottom: 16px;
}
.docs-tab {
    flex: 1; text-align: center;
    padding: 10px 10px; font-size: 0.82rem;
    font-weight: 600; color: #64748b;
    border-radius: 9px; cursor: pointer;
    border: none; background: transparent;
    transition: var(--transition);
    display: inline-flex; align-items: center;
    justify-content: center; gap: 6px;
}
.docs-tab.active {
    background: white; color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.docs-tab:active { transform: scale(0.96); }

.docs-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 14px;
    animation: fadeInUp 0.3s ease;
}
.docs-section-title {
    font-size: 0.95rem; font-weight: 700;
    color: #0f172a; margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
}
.docs-section-title i {
    color: var(--primary); font-size: 1rem;
}
.docs-section-desc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 12px;
}

.docs-endpoint {
    background: #0f172a;
    border-radius: 10px;
    padding: 12px 14px;
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.docs-endpoint::-webkit-scrollbar { display: none; }
.docs-endpoint .method {
    background: #10b981; color: #052e16;
    font-weight: 700; font-size: 0.62rem;
    padding: 3px 8px; border-radius: 5px;
    letter-spacing: 0.5px; flex-shrink: 0;
}
.docs-endpoint .method.get { background: #60a5fa; color: #082f49; }
.docs-endpoint .method.post { background: #10b981; color: #052e16; }
.docs-endpoint .url { color: #e2e8f0; }

.docs-auth-box {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.78rem;
    color: #1e40af;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.docs-auth-box i {
    font-size: 0.9rem; margin-top: 1px;
    flex-shrink: 0;
}
.docs-auth-box code {
    background: rgba(255,255,255,0.8);
    padding: 1px 6px; border-radius: 4px;
    font-size: 0.72rem; color: #0f172a;
}

/* Code sample block */
.docs-code-wrap {
    position: relative;
    margin-bottom: 12px;
}
.docs-code-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.docs-code {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 14px 14px;
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    margin: 0;
    word-break: normal;
    scrollbar-width: thin;
}
.docs-code::-webkit-scrollbar { height: 6px; }
.docs-code::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
.docs-code .cmt { color: #94a3b8; }
.docs-code .key { color: #93c5fd; }
.docs-code .str { color: #fcd34d; }
.docs-code .num { color: #fdba74; }
.docs-code .kw  { color: #c4b5fd; }
.docs-code .grn { color: #86efac; }
.docs-code .red { color: #fca5a5; }

.docs-copy-btn {
    position: absolute;
    top: 26px; right: 8px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 6px;
    padding: 4px 9px;
    font-size: 0.68rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
}
.docs-copy-btn:active { transform: scale(0.95); }
.docs-copy-btn:hover { background: rgba(255,255,255,0.28); }

/* Parameter table */
.docs-param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    margin-bottom: 8px;
}
.docs-param-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.docs-param-table tbody td {
    padding: 10px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: top;
    line-height: 1.5;
}
.docs-param-table tbody tr:last-child td {
    border-bottom: none;
}
.docs-param-table code {
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #0f172a;
    font-family: 'Courier New', monospace;
}
.docs-param-table .p-name {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    font-size: 0.75rem;
}
.docs-param-table .p-req {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    white-space: nowrap;
}
.docs-param-table .p-req.yes { background: #fee2e2; color: #991b1b; }
.docs-param-table .p-req.no  { background: #f1f5f9; color: #475569; }

.docs-callout {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.78rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}
.docs-callout i { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }
.docs-callout.info    { background: #eff6ff; border-left: 3px solid #3b82f6; color: #1e3a8a; }
.docs-callout.info i  { color: #3b82f6; }
.docs-callout.warn    { background: #fffbeb; border-left: 3px solid #f59e0b; color: #78350f; }
.docs-callout.warn i  { color: #f59e0b; }
.docs-callout.success { background: #f0fdf4; border-left: 3px solid #10b981; color: #064e3b; }
.docs-callout.success i { color: #10b981; }

/* Status badge mini */
.docs-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    white-space: nowrap;
}
.docs-badge.ok   { background: #d1fae5; color: #065f46; }
.docs-badge.err  { background: #fee2e2; color: #991b1b; }
.docs-badge.warn { background: #fef3c7; color: #92400e; }
.docs-badge.info { background: #dbeafe; color: #1e40af; }
.docs-badge.gray { background: #f1f5f9; color: #475569; }

/* List kecil */
.docs-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.docs-list li {
    padding: 6px 0 6px 20px;
    position: relative;
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.5;
}
.docs-list li::before {
    content: '•';
    position: absolute;
    left: 6px;
    color: var(--primary);
    font-weight: 700;
}
.docs-list li code {
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-family: 'Courier New', monospace;
    color: #0f172a;
}

.docs-placeholder {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}
.docs-placeholder i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}
.docs-placeholder h5 {
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
}
.docs-placeholder p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0;
}