:root {
    --wk-blue: #007AC3;
    --wk-blue-medium: #409BD2;
    --wk-blue-light: #A6D0EA;
    --wk-blue-ultra-light: #E8F4FB;
    --wk-green: #5A8A15;
    --wk-green-medium: #7BAA3C;
    --wk-teal: #00A3A1;
    --wk-teal-medium: #33B8B6;
    --wk-orange: #FF6B35;
    --wk-orange-medium: #FF8F66;
    --wk-orange-light: #FFDAC1;
    --wk-orange-ultra-light: #FFF3EC;
    --wk-red: #E5202E;
    --wk-purple: #6B21A8;
    --card-border-color: rgba(0, 0, 0, 0.3);
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --header-height: 56px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 11pt;
    color: var(--gray-800);
    line-height: 1.6;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 100;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.header-logo:hover { text-decoration: none; }

.logo-mark {
    background: var(--wk-blue);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
}

.logo-img {
    height: 28px;
    width: auto;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.primary-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s;
}

.primary-nav a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.primary-nav a.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.2);
    margin: 0 6px;
}

.help-link {
    color: rgba(255,255,255,0.7);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.help-link:hover { color: white; background: rgba(255,255,255,0.1); text-decoration: none; }
.help-link svg { width: 15px; height: 15px; fill: currentColor; }

/* ── Page Container ─────────────────────────────────────────────────────── */

.page-container {
    display: flex;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */

.sidebar-nav {
    width: 260px;
    min-width: 260px;
    background: white;
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-400);
    padding: 0 12px;
    margin-bottom: 6px;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
    padding: 0;
}

.sidebar-nav a {
    display: block;
    font-size: 13px;
    color: var(--gray-600);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1.4;
}

.sidebar-nav a:hover {
    color: var(--wk-orange);
    background: var(--wk-orange-ultra-light);
}

.sidebar-nav a.active {
    color: var(--wk-orange);
    background: var(--wk-orange-ultra-light);
    font-weight: 600;
}

/* ── Content Pane ───────────────────────────────────────────────────────── */

.content-pane {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.overview-content {
    padding: 32px 48px;
    max-width: 1100px;
}

.overview-content.hidden {
    display: none;
}

.detail-frame {
    display: none;
    width: 100%;
    height: 100%;
    border: none;
}

.detail-frame.visible {
    display: block;
}

/* ── Typography ─────────────────────────────────────────────────────────── */

h1 {
    color: var(--wk-orange);
    font-size: 28pt;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}

.lead {
    font-size: 13pt;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 32px;
}

h2 {
    font-size: 18pt;
    font-weight: 700;
    color: var(--gray-800);
    margin-top: 32px;
    margin-bottom: 16px;
    padding-top: 24px;
    border-top: 2px solid var(--gray-200);
}

h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

/* ── Reference Table ─────────────────────────────────────────────────────── */

.ref-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 16px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid var(--gray-200);
}

.ref-table thead th {
    background: linear-gradient(135deg, #2d3748, #4a5568);
    color: rgba(255,255,255,0.95);
    font-size: 9.5pt;
    font-weight: 600;
    text-align: left;
    padding: 11px 18px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border-bottom: 2px solid var(--gray-300);
}

.ref-table thead th:first-child {
    width: 200px;
}

.ref-table thead th:nth-child(3) {
    width: 110px;
}

.ref-table thead th:nth-child(4) {
    width: 140px;
}

.ref-table tbody tr {
    cursor: pointer;
    transition: all 0.15s;
}

.ref-table tbody tr:nth-child(even) {
    background-color: var(--gray-50);
}

.ref-table tbody tr:nth-child(odd) {
    background-color: white;
}

.ref-table tbody tr:hover {
    background: linear-gradient(90deg, #edf2f7, #e2e8f0);
    box-shadow: inset 3px 0 0 var(--wk-blue);
}

.ref-table tbody tr:last-child td {
    border-bottom: none;
}

.ref-table tbody td {
    padding: 10px 18px;
    font-size: 10pt;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-100);
    line-height: 1.5;
    vertical-align: middle;
}

.ref-table tbody td.ref-name {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 10pt;
    font-weight: 600;
    color: var(--wk-blue);
    white-space: nowrap;
}

.ref-table tbody tr:hover td.ref-name {
    color: var(--gray-900);
}

.ref-table tbody td.ref-type {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 9pt;
    color: var(--gray-500);
}

.ref-table tbody td.ref-format {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 9pt;
    color: var(--gray-500);
}

/* ── Callout ────────────────────────────────────────────────────────────── */

.callout {
    border-left: 4px solid var(--wk-blue);
    background: var(--wk-blue-ultra-light);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 32px;
    font-size: 10pt;
    line-height: 1.6;
}

.callout strong {
    display: block;
    margin-bottom: 4px;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

/* ── Sidebar Collapsible Groups ──────────────────────────────────────────── */

.sidebar-group-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    user-select: none;
    transition: background 0.15s, color 0.15s;
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.sidebar-group-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.toggle-chevron {
    width: 10px;
    height: 10px;
    fill: currentColor;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sidebar-group-toggle.open .toggle-chevron {
    transform: rotate(90deg);
}

.sidebar-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s ease;
}

.sidebar-group-list.collapsed {
    max-height: 0;
}

/* ── Table Group Headings ───────────────────────────────────────────────── */

.table-group {
    margin-bottom: 32px;
}

.table-group-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13pt;
    font-weight: 700;
    color: var(--gray-700);
    margin: 0 0 4px 0;
    padding: 10px 0 8px;
    border-bottom: 2px solid var(--wk-teal-medium);
    border-top: none;
}

.table-group-heading .group-icon {
    width: 22px;
    height: 22px;
    fill: var(--wk-teal);
    flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .sidebar-nav {
        display: none;
    }

    .overview-content {
        padding: 24px 20px;
    }

    .ref-table thead th:first-child {
        width: auto;
    }

    .ref-table tbody td.ref-name {
        font-size: 9pt;
    }
}
