/* app/static/css/admin/dokumentasi.css — v2.2 Responsive Fix */
/* ============================================================
   SIMAPI — Dokumentasi Page (Multi-Database + IoT)
   FIX: TOC tidak tumpang tindih, responsive mobile
   ============================================================ */

:root {
    --grad-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --grad-blue: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --grad-purple: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --grad-green: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --grad-orange: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --grad-pink: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --grad-hero: linear-gradient(135deg, #1e3a8a 0%, #6d28d9 50%, #be185d 100%);

    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-soft: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.12);
    --shadow-xl: 0 24px 64px rgba(0,0,0,.16);
}

[data-theme="dark"] {
    --bg-page: #0b1120;
    --bg-card: #1e293b;
    --bg-soft: #334155;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.doc-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background .3s, color .3s;
    -webkit-text-size-adjust: 100%;
}

img, svg {
    max-width: 100%;
    height: auto;
}

pre {
    white-space: pre;
    overflow-x: auto;
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 4px;
    background: var(--grad-hero);
    z-index: 99999;
    width: 0%;
    transition: width .1s;
    box-shadow: 0 0 12px rgba(139, 92, 246, .6);
}

/* ============================================================
   NAVBAR — RESPONSIVE
   ============================================================ */
.doc-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all .3s;
}

[data-theme="dark"] .doc-navbar {
    background: rgba(30, 41, 59, .85);
}

.doc-navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: .85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.doc-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.doc-brand-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grad-hero);
    border-radius: 10px;
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 8px 20px rgba(139, 92, 246, .4);
    animation: float 3s ease-in-out infinite;
    flex-shrink: 0;
}

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

.doc-brand-text {
    background: var(--grad-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.doc-navbar-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.doc-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: .45rem .7rem;
    border-radius: 8px;
    transition: all .2s;
    font-size: .85rem;
    white-space: nowrap;
}

.doc-nav-link:hover {
    color: var(--text-main);
    background: var(--bg-soft);
}

.doc-theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .25s;
    flex-shrink: 0;
}

.doc-theme-toggle:hover {
    background: var(--bg-soft);
    transform: rotate(20deg);
}

.doc-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1rem;
    border: none;
    border-radius: 9px;
    background: var(--grad-primary);
    color: #fff;
    font-weight: 600;
    font-size: .82rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(102, 126, 234, .35);
    transition: all .25s;
    white-space: nowrap;
}

.doc-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, .5);
}

/* ============================================================
   HERO
   ============================================================ */
.doc-hero {
    position: relative;
    padding: 5rem 1.25rem 5rem;
    background: var(--grad-hero);
    overflow: hidden;
    text-align: center;
}

.doc-hero::before,
.doc-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .55;
    animation: blob 12s infinite;
    pointer-events: none;
}

.doc-hero::before {
    width: 400px;
    height: 400px;
    background: #ec4899;
    top: -100px;
    left: -100px;
}

.doc-hero::after {
    width: 500px;
    height: 500px;
    background: #06b6d4;
    bottom: -200px;
    right: -150px;
    animation-delay: -6s;
}

@keyframes blob {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(.9); }
}

.doc-hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.doc-hero-title {
    font-size: clamp(1.5rem, 5vw, 3.5rem);
    font-weight: 900;
    color: #fff;
    margin-bottom: 1rem;
    letter-spacing: -.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
    line-height: 1.15;
}

.doc-hero-subtitle {
    font-size: clamp(.95rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, .9);
    margin-bottom: 1.75rem;
    padding: 0 .5rem;
}

.doc-hero-meta {
    display: flex;
    gap: .5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.badge-doc {
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .25);
    color: #fff;
    padding: .35rem .85rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================================
   MAIN LAYOUT — FLEX dengan SIDEBAR STICKY
   ============================================================ */
.doc-main {
    max-width: 1400px;
    margin: -3rem auto 0;
    padding: 0 1.25rem 3rem;
    position: relative;
    z-index: 2;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.doc-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
}

.doc-content {
    flex: 1;
    min-width: 0;
}

/* ============================================================
   TOC (Table of Contents)
   ============================================================ */
.doc-toc {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.doc-toc-header {
    padding: 1rem 1.15rem;
    font-weight: 700;
    font-size: .95rem;
    background: var(--grad-primary);
    color: #fff;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.doc-toc-body {
    padding: .65rem;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
}

.doc-toc-body::-webkit-scrollbar {
    width: 6px;
}

.doc-toc-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.doc-toc-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .6rem .8rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: .85rem;
    border-radius: 10px;
    margin-bottom: .15rem;
    transition: all .2s;
}

.doc-toc-link:hover {
    background: var(--bg-soft);
    color: var(--text-main);
    transform: translateX(4px);
}

.doc-toc-link.active {
    background: var(--grad-blue);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 172, 254, .35);
}

.doc-toc-link i {
    font-size: .95rem;
    flex-shrink: 0;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.doc-section {
    scroll-margin-top: 90px;
    margin-bottom: 2.5rem;
    animation: fadeUp .5s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.doc-section-title {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 800;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    background: var(--grad-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
    flex-wrap: wrap;
}

.doc-section-title i {
    background: var(--grad-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: clamp(1.5rem, 3vw, 2rem);
    flex-shrink: 0;
}

/* ============================================================
   CARDS
   ============================================================ */
.doc-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: all .3s;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.doc-card:hover {
    box-shadow: var(--shadow-lg);
}

.doc-card h5 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
    font-size: 1.1rem;
}

.doc-card h6 {
    font-weight: 700;
    font-size: .95rem;
    color: var(--text-main);
    margin-top: 1.5rem;
    margin-bottom: .75rem;
}

.doc-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: .93rem;
}

.doc-card code {
    background: var(--bg-soft);
    padding: .15rem .45rem;
    border-radius: 5px;
    font-size: .82rem;
    color: #db2777;
    font-family: 'Courier New', monospace;
    word-break: break-word;
}

[data-theme="dark"] .doc-card code {
    color: #f9a8d4;
}

/* ============================================================
   CALLOUT
   ============================================================ */
.doc-callout {
    display: flex;
    gap: .85rem;
    padding: .9rem 1.1rem;
    border-radius: 12px;
    margin-top: 1rem;
    align-items: flex-start;
    border-left: 4px solid;
    font-size: .9rem;
}

.doc-callout i {
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: .1rem;
}

.doc-callout-info {
    background: rgba(59, 130, 246, .08);
    border-color: #3b82f6;
    color: #1e40af;
}

[data-theme="dark"] .doc-callout-info {
    background: rgba(59, 130, 246, .15);
    color: #93c5fd;
}

.doc-callout-warning {
    background: rgba(245, 158, 11, .08);
    border-color: #f59e0b;
    color: #92400e;
}

[data-theme="dark"] .doc-callout-warning {
    background: rgba(245, 158, 11, .15);
    color: #fcd34d;
}

/* ============================================================
   FEATURE GRID
   ============================================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.doc-feature {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all .3s;
}

.doc-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.doc-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
}

.doc-feature > div:last-child {
    flex: 1;
    min-width: 0;
}

.doc-feature h5 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .35rem;
    color: var(--text-main);
    line-height: 1.3;
}

.doc-feature p {
    font-size: .88rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.55;
}

.gradient-blue { background: var(--grad-blue); }
.gradient-purple { background: var(--grad-purple); }
.gradient-green { background: var(--grad-green); }
.gradient-orange { background: var(--grad-orange); }
.gradient-pink { background: var(--grad-pink); }
.gradient-cyan { background: var(--grad-cyan); }

/* ============================================================
   DATABASE GRID
   ============================================================ */
.db-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .85rem;
    margin-top: 1.25rem;
}

.db-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 1.15rem 1rem;
    text-align: center;
    border: 2px solid var(--border);
    transition: all .3s;
    position: relative;
    overflow: hidden;
}

.db-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--grad-primary);
    transform: scaleX(0);
    transition: transform .3s;
}

.db-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.db-card:hover::before {
    transform: scaleX(1);
}

.db-card-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto .65rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
}

.db-card-name {
    font-weight: 700;
    font-size: .95rem;
    color: var(--text-main);
    margin-bottom: .2rem;
}

.db-card-port {
    font-size: .75rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.db-card-badge {
    position: absolute;
    top: .65rem;
    right: .65rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-ready {
    background: #dcfce7;
    color: #166534;
}

.badge-optional {
    background: #fef3c7;
    color: #92400e;
}

[data-theme="dark"] .badge-ready {
    background: rgba(16, 185, 129, .2);
    color: #6ee7b7;
}

[data-theme="dark"] .badge-optional {
    background: rgba(245, 158, 11, .2);
    color: #fcd34d;
}

/* ============================================================
   STEPS
   ============================================================ */
.doc-steps {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.doc-step {
    display: flex;
    gap: 1.1rem;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all .3s;
}

.doc-step:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.doc-step-number {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--grad-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(102, 126, 234, .35);
}

.doc-step-content {
    flex: 1;
    min-width: 0;
}

.doc-step-content h5 {
    font-weight: 700;
    margin-bottom: .4rem;
    color: var(--text-main);
    font-size: .98rem;
}

.doc-step-content p {
    color: var(--text-muted);
    margin-bottom: .65rem;
    font-size: .9rem;
}

.doc-step-content ul {
    padding-left: 1.2rem;
    color: var(--text-muted);
    font-size: .88rem;
}

.doc-step-content li {
    margin-bottom: .2rem;
}

/* ============================================================
   CODE BLOCK
   ============================================================ */
.doc-code-block {
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden;
    margin: .65rem 0;
    box-shadow: var(--shadow-md);
    border: 1px solid #1e293b;
    max-width: 100%;
}

.doc-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .55rem .9rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    color: #94a3b8;
    font-size: .75rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    gap: .5rem;
}

.doc-code-header span {
    display: flex;
    align-items: center;
    gap: .35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-copy-btn {
    background: rgba(255, 255, 255, .08);
    border: none;
    color: #94a3b8;
    padding: .3rem .55rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: .78rem;
    transition: all .2s;
    flex-shrink: 0;
}

.doc-copy-btn:hover {
    background: var(--grad-primary);
    color: #fff;
}

.doc-code-block pre {
    margin: 0;
    padding: 1rem 1.1rem;
    overflow-x: auto;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: .78rem;
    line-height: 1.55;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.doc-code-block code {
    color: inherit;
    font-family: inherit;
    background: transparent;
    padding: 0;
}

/* ============================================================
   ENDPOINT
   ============================================================ */
.doc-endpoint {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .9rem;
    background: var(--bg-soft);
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: .85rem;
    border: 1px solid var(--border);
    margin-bottom: .65rem;
    flex-wrap: wrap;
    overflow-wrap: break-word;
    word-break: break-all;
}

.doc-method {
    padding: .2rem .6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: .7rem;
    letter-spacing: .05em;
    color: #fff;
    flex-shrink: 0;
}

.doc-method-get { background: var(--grad-blue); }
.doc-method-post { background: var(--grad-green); }
.doc-method-put { background: var(--grad-orange); }
.doc-method-delete { background: var(--grad-pink); }

/* ============================================================
   TABLES
   ============================================================ */
.doc-table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: .85rem 0;
    -webkit-overflow-scrolling: touch;
}

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

.doc-table thead {
    background: var(--grad-primary);
    color: #fff;
}

.doc-table th {
    padding: .7rem .85rem;
    text-align: left;
    font-weight: 700;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.doc-table td {
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.doc-table tbody tr {
    background: var(--bg-card);
    transition: background .15s;
}

.doc-table tbody tr:hover {
    background: var(--bg-soft);
}

.doc-table tbody tr:last-child td {
    border-bottom: none;
}

.doc-table code {
    background: var(--bg-soft);
    padding: .1rem .35rem;
    border-radius: 4px;
    font-size: .78rem;
    color: #db2777;
    font-family: 'Courier New', monospace;
    word-break: break-word;
}

[data-theme="dark"] .doc-table code {
    background: #334155;
    color: #f9a8d4;
}

.doc-status {
    padding: .2rem .55rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: .72rem;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.doc-status-4xx {
    background: rgba(245, 158, 11, .15);
    color: #d97706;
}

.doc-status-5xx {
    background: rgba(239, 68, 68, .15);
    color: #dc2626;
}

/* ============================================================
   TABS — Responsive (horizontal scroll di mobile)
   ============================================================ */
.doc-tabs {
    display: flex;
    gap: .4rem;
    margin-bottom: .85rem;
    flex-wrap: nowrap;
    padding: .3rem;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.doc-tabs::-webkit-scrollbar {
    height: 4px;
}

.doc-tabs::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.doc-tab {
    padding: .55rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    font-size: .82rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.doc-tab:hover {
    background: var(--bg-soft);
    color: var(--text-main);
}

.doc-tab.active {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, .35);
}

.doc-tab-content {
    display: none;
    animation: fadeUp .3s;
}

.doc-tab-content.active {
    display: block;
}

/* ============================================================
   FAQ
   ============================================================ */
.doc-faq {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.doc-faq-item {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all .2s;
}

.doc-faq-item:hover {
    box-shadow: var(--shadow-sm);
}

.doc-faq-question {
    width: 100%;
    padding: 1rem 1.15rem;
    background: none;
    border: none;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .65rem;
    cursor: pointer;
    font-weight: 600;
    font-size: .93rem;
    color: var(--text-main);
    transition: background .2s;
    font-family: inherit;
    line-height: 1.4;
}

.doc-faq-question:hover {
    background: var(--bg-soft);
}

.doc-faq-question i {
    transition: transform .3s;
    color: var(--text-muted);
    flex-shrink: 0;
}

.doc-faq-item.open .doc-faq-question i {
    transform: rotate(180deg);
    color: #8b5cf6;
}

.doc-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
}

.doc-faq-item.open .doc-faq-answer {
    max-height: 2000px;
}

.doc-faq-answer > * {
    padding: 0 1.15rem;
}

.doc-faq-answer > *:last-child {
    padding-bottom: 1.15rem;
}

.doc-faq-answer p {
    color: var(--text-muted);
    margin: 0 0 .5rem;
    font-size: .88rem;
}

.doc-faq-answer ul,
.doc-faq-answer ol {
    padding-left: 1.4rem;
    color: var(--text-muted);
    margin-bottom: .5rem;
    font-size: .88rem;
}

.doc-faq-answer li {
    margin-bottom: .3rem;
}

.doc-faq-answer code {
    background: var(--bg-soft);
    padding: .1rem .4rem;
    border-radius: 5px;
    font-size: .8rem;
    color: #db2777;
    font-family: 'Courier New', monospace;
    word-break: break-word;
}

[data-theme="dark"] .doc-faq-answer code {
    color: #f9a8d4;
}

/* ============================================================
   FOOTER
   ============================================================ */
.doc-footer {
    background: var(--grad-hero);
    color: #fff;
    padding: 2.5rem 1.25rem;
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
}

.doc-footer::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, .1);
    border-radius: 50%;
    filter: blur(60px);
    top: -100px;
    right: -100px;
    pointer-events: none;
}

.doc-footer-inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.doc-footer-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: .65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.doc-footer-text {
    color: rgba(255, 255, 255, .85);
    margin-bottom: .5rem;
    font-size: .9rem;
}

.doc-footer-copy {
    color: rgba(255, 255, 255, .65);
    font-size: .78rem;
    line-height: 1.5;
}

/* ============================================================
   LOGIN MODAL
   ============================================================ */
.login-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn .2s;
}

.login-modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-modal {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 1.75rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modalIn .3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from { transform: scale(.95) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.login-modal-close {
    position: absolute;
    top: .85rem;
    right: .85rem;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: var(--bg-soft);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.login-modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: rotate(90deg);
}

.login-modal-brand {
    text-align: center;
    margin-bottom: 1.25rem;
}

.login-modal-brand i {
    font-size: 2.5rem;
    background: var(--grad-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-modal-brand h3 {
    font-weight: 800;
    margin-top: .4rem;
    background: var(--grad-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.2rem;
}

.login-modal-brand p {
    color: var(--text-muted);
    font-size: .82rem;
    margin: .15rem 0 0;
}

.login-modal .form-label {
    font-weight: 600;
    font-size: .82rem;
    color: var(--text-main);
}

.login-modal .form-control {
    padding: .7rem .9rem;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--bg-soft);
    color: var(--text-main);
    transition: all .2s;
    font-size: .9rem;
}

.login-modal .form-control:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .1);
    background: var(--bg-card);
}

.login-modal .captcha-box {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: .25rem;
    cursor: pointer;
    transition: all .2s;
    background: #f0f4f8;
}

.login-modal .captcha-box:hover {
    border-color: #8b5cf6;
}

.login-modal .captcha-box img {
    border-radius: 8px;
    display: block;
    height: 48px;
    width: auto;
    pointer-events: none;
}

.login-modal .captcha-refresh {
    background: none;
    border: none;
    color: #8b5cf6;
    font-size: .78rem;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.login-modal .captcha-refresh:hover {
    text-decoration: underline;
}

#modalSubmitBtn {
    padding: .8rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 8px 24px rgba(102, 126, 234, .35);
    transition: all .2s;
}

#modalSubmitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, .5);
}

#modalSubmitBtn:disabled {
    opacity: .7;
    transform: none;
}

.login-modal-error {
    padding: .7rem .9rem;
    border-radius: 10px;
    background: #fee2e2;
    color: #991b1b;
    font-size: .82rem;
    margin-bottom: .9rem;
    border-left: 3px solid #dc2626;
    display: flex;
    align-items: center;
    gap: .5rem;
}

[data-theme="dark"] .login-modal-error {
    background: rgba(239, 68, 68, .15);
    color: #fca5a5;
}

.login-modal-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: .72rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

/* ============================================================
   RESPONSIVE — TABLET (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .doc-main {
        flex-direction: column;
        gap: 1.5rem;
        margin-top: -2rem;
    }

    .doc-sidebar {
        position: static;
        width: 100%;
        max-height: none;
    }

    .doc-toc {
        max-height: none;
    }

    .doc-toc-body {
        max-height: 280px;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: .25rem;
    }

    .doc-toc-link {
        margin-bottom: 0;
    }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Navbar — sembunyikan link, tampilkan tombol saja */
    .doc-navbar-inner {
        padding: .7rem 1rem;
    }

    .doc-navbar-actions .doc-nav-link {
        display: none;
    }

    .doc-brand-text {
        font-size: 1.1rem;
    }

    .doc-brand-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .doc-nav-btn {
        padding: .5rem .85rem;
        font-size: .78rem;
    }

    .doc-nav-btn span {
        display: none;
    }

    .doc-theme-toggle {
        width: 34px;
        height: 34px;
    }

    /* Hero */
    .doc-hero {
        padding: 3.5rem 1rem 3.5rem;
    }

    .doc-hero-title {
        gap: .4rem;
    }

    .doc-hero-title i {
        font-size: 1.5rem;
    }

    .doc-hero-subtitle {
        font-size: .9rem;
        margin-bottom: 1.25rem;
    }

    .badge-doc {
        padding: .3rem .7rem;
        font-size: .72rem;
    }

    /* Content */
    .doc-main {
        padding: 0 .85rem 2rem;
        margin-top: -1.5rem;
    }

    .doc-section {
        margin-bottom: 1.75rem;
        scroll-margin-top: 70px;
    }

    .doc-section-title {
        font-size: 1.2rem;
        gap: .5rem;
    }

    .doc-section-title i {
        font-size: 1.35rem;
    }

    /* Card */
    .doc-card {
        padding: 1.15rem;
        border-radius: 14px;
    }

    .doc-card h5 {
        font-size: 1rem;
    }

    .doc-card h6 {
        font-size: .88rem;
    }

    .doc-card p {
        font-size: .87rem;
    }

    /* Feature */
    .doc-feature {
        padding: 1rem;
        gap: .75rem;
    }

    .doc-feature-icon {
        width: 42px;
        height: 42px;
        font-size: 1.15rem;
    }

    .doc-feature h5 {
        font-size: .93rem;
    }

    .doc-feature p {
        font-size: .83rem;
    }

    /* Database grid — 2 kolom di mobile */
    .db-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: .65rem;
    }

    .db-card {
        padding: .85rem .65rem;
    }

    .db-card-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .db-card-name {
        font-size: .85rem;
    }

    .db-card-port {
        font-size: .7rem;
    }

    .db-card-badge {
        font-size: .55rem;
        padding: .1rem .4rem;
        top: .5rem;
        right: .5rem;
    }

    /* Steps — vertikal di mobile */
    .doc-step {
        flex-direction: column;
        gap: .75rem;
        padding: 1rem;
    }

    .doc-step-number {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .doc-step-content h5 {
        font-size: .9rem;
    }

    .doc-step-content p,
    .doc-step-content ul {
        font-size: .85rem;
    }

    /* Code block */
    .doc-code-block {
        border-radius: 10px;
    }

    .doc-code-header {
        font-size: .7rem;
        padding: .5rem .75rem;
    }

    .doc-copy-btn {
        font-size: .72rem;
        padding: .25rem .5rem;
    }

    .doc-code-block pre {
        padding: .85rem;
        font-size: .72rem;
        line-height: 1.5;
    }

    /* Endpoint */
    .doc-endpoint {
        font-size: .78rem;
        padding: .55rem .75rem;
    }

    /* Tables */
    .doc-table {
        font-size: .78rem;
        min-width: 420px;
    }

    .doc-table th {
        padding: .55rem .65rem;
        font-size: .65rem;
    }

    .doc-table td {
        padding: .55rem .65rem;
    }

    /* Tabs — scroll horizontal */
    .doc-tabs {
        padding: .25rem;
        gap: .25rem;
    }

    .doc-tab {
        padding: .45rem .85rem;
        font-size: .75rem;
    }

    /* FAQ */
    .doc-faq-question {
        padding: .85rem 1rem;
        font-size: .85rem;
    }

    .doc-faq-answer > * {
        padding: 0 1rem;
    }

    .doc-faq-answer > *:last-child {
        padding-bottom: 1rem;
    }

    .doc-faq-answer p,
    .doc-faq-answer ul,
    .doc-faq-answer ol {
        font-size: .82rem;
    }

    /* Footer */
    .doc-footer {
        padding: 2rem 1rem;
        margin-top: 2rem;
    }

    .doc-footer-title {
        font-size: 1.15rem;
    }

    .doc-footer-text {
        font-size: .82rem;
    }

    .doc-footer-copy {
        font-size: .7rem;
    }

    /* TOC — grid 1 kolom */
    .doc-toc-body {
        display: grid;
        grid-template-columns: 1fr;
        max-height: 240px;
    }

    /* Login modal */
    .login-modal {
        padding: 1.4rem;
        border-radius: 16px;
    }

    .login-modal-brand i {
        font-size: 2rem;
    }

    .login-modal-brand h3 {
        font-size: 1.1rem;
    }

    .login-modal .captcha-box img {
        height: 42px;
    }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
    .doc-navbar-inner {
        padding: .6rem .75rem;
    }

    .doc-brand-text {
        font-size: 1rem;
    }

    .doc-navbar-actions {
        gap: .35rem;
    }

    .doc-nav-btn {
        padding: .45rem .7rem;
        font-size: .72rem;
    }

    .doc-hero {
        padding: 3rem .85rem 3rem;
    }

    .doc-hero-title {
        font-size: 1.35rem;
        gap: .35rem;
    }

    .doc-hero-subtitle {
        font-size: .82rem;
    }

    .badge-doc {
        font-size: .65rem;
        padding: .25rem .6rem;
    }

    .doc-main {
        padding: 0 .65rem 1.5rem;
        margin-top: -1rem;
    }

    .doc-section-title {
        font-size: 1.05rem;
    }

    .doc-section-title i {
        font-size: 1.15rem;
    }

    .doc-card {
        padding: .95rem;
        border-radius: 12px;
    }

    .doc-card h5 {
        font-size: .93rem;
    }

    .doc-code-block pre {
        padding: .7rem;
        font-size: .68rem;
    }

    .doc-code-header {
        font-size: .65rem;
        padding: .45rem .65rem;
    }

    .doc-step {
        padding: .85rem;
    }

    .doc-step-number {
        width: 34px;
        height: 34px;
        font-size: .9rem;
    }

    .doc-step-content h5 {
        font-size: .85rem;
    }

    .doc-step-content p,
    .doc-step-content ul {
        font-size: .8rem;
    }

    .db-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: .55rem;
    }

    .db-card {
        padding: .75rem .55rem;
    }

    .db-card-icon {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
        margin-bottom: .5rem;
    }

    .db-card-name {
        font-size: .78rem;
    }

    .db-card-port {
        font-size: .65rem;
    }

    .doc-tab {
        padding: .4rem .7rem;
        font-size: .72rem;
    }

    .doc-faq-question {
        padding: .75rem .85rem;
        font-size: .8rem;
    }

    .doc-faq-answer > * {
        padding: 0 .85rem;
    }

    .doc-faq-answer > *:last-child {
        padding-bottom: .85rem;
    }

    .doc-faq-answer p,
    .doc-faq-answer ul,
    .doc-faq-answer ol {
        font-size: .78rem;
    }

    .doc-callout {
        padding: .75rem .85rem;
        font-size: .82rem;
        gap: .65rem;
    }

    .doc-callout i {
        font-size: 1rem;
    }

    .login-modal {
        padding: 1.15rem;
    }

    .doc-footer {
        padding: 1.5rem .85rem;
    }
}

/* ============================================================
   AKSESIBILITAS — focus visible
   ============================================================ */
.doc-nav-link:focus-visible,
.doc-nav-btn:focus-visible,
.doc-theme-toggle:focus-visible,
.doc-toc-link:focus-visible,
.doc-tab:focus-visible,
.doc-faq-question:focus-visible,
.doc-copy-btn:focus-visible,
.login-modal-close:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}