/* ──────────────────────────────────
   Billing Mitracom Docs — Style
   Inspired by docs.radboox.com
   ────────────────────────────────── */

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    --sidebar-bg: #f0f5ff;
    --sidebar-border: #dbeafe;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --bg: #ffffff;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --code-bg: #f1f5f9;
    --header-height: 60px;
    --sidebar-width: 260px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 15px;
}

/* ── Header ── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
}

.header-btn {
    background: var(--primary);
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn:hover {
    background: #1d4ed8;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    overflow-y: auto;
    padding: 16px 0;
    z-index: 90;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-group {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.04);
}

.nav-item.active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: rgba(37, 99, 235, 0.06);
    font-weight: 600;
}

.nav-parent {
    font-weight: 600;
}

.nav-child {
    padding-left: 52px;
    font-weight: 400;
    font-size: 13px;
    color: var(--text-light);
}

.nav-child:hover,
.nav-child.active {
    color: var(--primary);
}

.nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

/* ── Content ── */
.content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 40px 60px 60px;
    max-width: 960px;
    min-height: calc(100vh - var(--header-height));
}

section {
    margin-bottom: 24px;
    scroll-margin-top: 80px;
}

h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-top: 32px;
    margin-bottom: 12px;
}

h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 8px;
}

h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-top: 20px;
    margin-bottom: 6px;
}

p {
    margin-bottom: 14px;
    color: var(--text);
    line-height: 1.8;
}

.updated {
    display: inline-block;
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 16px;
    font-weight: 500;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

ul {
    margin: 8px 0 16px 24px;
}

li {
    margin-bottom: 6px;
    color: var(--text);
}

li strong {
    color: var(--text);
}

code {
    background: var(--code-bg);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--primary);
}

/* ── Tables ── */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 20px;
    font-size: 14px;
}

.doc-table thead th {
    text-align: left;
    padding: 10px 14px;
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
    border-bottom: 2px solid var(--sidebar-border);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.doc-table tbody tr:hover {
    background: #fafbfc;
}

/* ── Callouts ── */
.callout {
    padding: 14px 18px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
    line-height: 1.6;
    border-left: 4px solid;
}

.callout-info {
    background: #eff6ff;
    border-color: var(--primary);
    color: #1e40af;
}

.callout-warning {
    background: #fffbeb;
    border-color: var(--warning);
    color: #92400e;
}

.callout-danger {
    background: #fef2f2;
    border-color: var(--danger);
    color: #991b1b;
}

/* ── Doc Images (Screenshots) ── */
.doc-img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin: 16px 0 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.doc-img:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ── Feature Grid ── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.feature-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.feature-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}

.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.feature-card h4 {
    margin: 0 0 6px;
    font-size: 15px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

/* ── Footer ── */
.footer {
    margin-top: 60px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Sidebar Toggle (Mobile) ── */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 22px;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
    align-items: center;
    justify-content: center;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        z-index: 150;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.1);
    }
    .content {
        margin-left: 0;
        padding: 24px 20px 40px;
    }
    .sidebar-toggle {
        display: flex;
    }
    .header-title {
        font-size: 15px;
    }
    h1 { font-size: 26px; }
    h2 { font-size: 20px; }
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .content {
        padding: 20px 16px 32px;
    }
}
