/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #1a202c;
    --accent: #ed8936;
    --accent-hover: #dd6b20;
    --success: #38a169;
    --warning: #d69e2e;
    --danger: #e53e3e;
    --info: #3182ce;

    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --gray-900: #171923;

    --sidebar-width: 280px;
    --sidebar-collapsed-width: 60px;
    --header-height: 60px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --transition: all 0.2s ease;
}

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--gray-100);
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-dark);
    color: white;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: relative;
    z-index: 100;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.logo-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .sidebar-toggle span {
    transform: rotate(180deg);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.new-project-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    margin-bottom: 16px;
}

.new-project-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.sidebar.collapsed .new-project-btn .btn-text {
    display: none;
}

.sidebar.collapsed .new-project-btn {
    justify-content: center;
    padding: 12px;
}

.btn-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.search-box {
    position: relative;
    margin-bottom: 16px;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
    transition: var(--transition);
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-box input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

.sidebar.collapsed .search-box {
    display: none;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.project-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.project-item.active {
    background: var(--primary-light);
}

.project-item-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.project-item-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.project-item-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-item-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.project-item-status {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 4px;
    display: inline-block;
}

.project-item-status.analyzed {
    background: var(--success);
}

.project-item-status.draft {
    background: var(--warning);
    color: var(--gray-800);
}

.sidebar.collapsed .project-item-content {
    display: none;
}

.sidebar.collapsed .project-item {
    justify-content: center;
    padding: 12px 8px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar.collapsed .sidebar-footer .footer-info {
    display: none;
}

.footer-info {
    color: rgba(255, 255, 255, 0.5);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 13px;
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.sidebar.collapsed .logout-btn .logout-text {
    display: none;
}

.sidebar.collapsed .logout-btn {
    justify-content: center;
    padding: 10px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--gray-100);
}

/* ============================================================
   WELCOME SCREEN
   ============================================================ */
.welcome-screen {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.welcome-content {
    text-align: center;
    max-width: 800px;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.welcome-content h1 {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 16px;
}

.welcome-content > p {
    font-size: 18px;
    color: var(--gray-600);
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

.feature-card h3 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 13px;
    color: var(--gray-600);
}

/* ============================================================
   PROJECT PAGE
   ============================================================ */
.project-container {
    height: 100%;
    width: 100%;
    position: relative;
}

.upload-section {
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.upload-header h2 {
    font-size: 24px;
    color: var(--primary);
}

.upload-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.upload-dropzone {
    flex: 1;
    min-height: 300px;
    border: 3px dashed var(--gray-300);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--accent);
    background: var(--gray-50);
}

.dropzone-content {
    text-align: center;
    padding: 40px;
}

.dropzone-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.dropzone-content h3 {
    font-size: 20px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.dropzone-content p {
    color: var(--gray-500);
}

.dropzone-hint {
    font-size: 12px;
    margin-top: 16px;
}

.upload-area-flex {
    display: flex;
    gap: 24px;
    flex: 1;
}

.upload-area-flex > .upload-dropzone {
    flex: 1;
}

.text-input-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.text-input-container h3 {
    font-size: 20px;
    color: var(--gray-700);
    margin-bottom: 16px;
}

.context-textarea {
    width: 100%;
    flex: 1;
    resize: none;
    padding: 16px;
    border-radius: var(--radius-xl);
    border: 3px dashed var(--gray-300);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}
.context-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Uploaded Files */
.uploaded-files {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.uploaded-files h3 {
    margin-bottom: 16px;
    color: var(--primary);
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.file-icon {
    font-size: 24px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--gray-800);
}

.file-size {
    font-size: 12px;
    color: var(--gray-500);
}

.file-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
}

.file-remove:hover {
    color: var(--danger);
}

.upload-controls {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Analysis Progress */
.analysis-progress {
    background: white;
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow);
}

.progress-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.analysis-progress h3 {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 8px;
}

.analysis-progress p {
    color: var(--gray-600);
}

.progress-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 16px;
}

/* MV Tool Section - Full viewport iframe */
.mv-tool-section {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-100);
}

.mv-tool-section.active {
    display: block;
}

.mv-tool-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c53030;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

.modal-small {
    max-width: 400px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-800);
}

.modal-body {
    padding: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    background: var(--gray-800);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 400px;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
    color: var(--gray-800);
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 200;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: var(--sidebar-width);
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .upload-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .upload-controls {
        flex-direction: column;
    }
}

/* ============================================================
   ANALYSIS PROGRESS DETAILS
   ============================================================ */
.progress-details {
    margin: 20px 0;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.progress-details p {
    margin: 8px 0;
    color: var(--gray-700);
}

.progress-details p.detail {
    font-size: 12px;
    color: var(--gray-500);
    margin-left: 24px;
}

.progress-details p.error {
    color: var(--danger);
    font-weight: 600;
}

.progress-details .token-count {
    font-family: 'Consolas', 'Monaco', monospace;
    background: var(--gray-200);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ============================================================
   API USAGE PANEL
   ============================================================ */
.api-panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
}

.api-panel-overlay.open {
    display: block;
}

.api-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    max-width: 100%;
    height: 100%;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.api-panel.open {
    right: 0;
}

.api-panel-header {
    padding: 20px 24px;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.api-panel-header h3 {
    margin: 0;
    font-size: 18px;
}

.api-panel-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

.api-panel-close:hover {
    opacity: 1;
}

.api-panel-summary {
    padding: 16px 24px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.api-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.api-stat {
    background: white;
    padding: 12px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.api-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.api-stat-label {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-top: 4px;
}

.api-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.api-loading,
.api-empty,
.api-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.api-error {
    color: var(--danger);
}

.api-call-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}

.api-call-card.success {
    border-left: 4px solid var(--success);
}

.api-call-card.error {
    border-left: 4px solid var(--danger);
}

.api-call-card.pending {
    border-left: 4px solid var(--warning);
}

.api-call-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.api-call-number {
    font-weight: 700;
    color: var(--primary);
}

.api-call-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.api-call-status.status-success {
    background: #c6f6d5;
    color: #276749;
}

.api-call-status.status-error {
    background: #fed7d7;
    color: #c53030;
}

.api-call-status.status-pending {
    background: #fefcbf;
    color: #975a16;
}

.api-call-time {
    margin-left: auto;
    font-size: 12px;
    color: var(--gray-500);
}

.api-call-body {
    padding: 12px 16px;
}

.api-call-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px dashed var(--gray-200);
}

.api-call-row:last-child {
    border-bottom: none;
}

.api-call-row.error {
    background: #fff5f5;
    margin: 8px -16px -12px;
    padding: 12px 16px;
    border-bottom: none;
}

.api-call-label {
    font-size: 12px;
    color: var(--gray-500);
    flex-shrink: 0;
}

.api-call-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
    text-align: right;
    word-break: break-word;
}

.api-call-summary {
    max-width: 250px;
    font-size: 12px;
    font-weight: 400;
    color: var(--gray-600);
}

/* Responsive adjustments */
@media (max-width: 500px) {
    .api-panel {
        width: 100%;
        right: -100%;
    }

    .api-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   SIDEBAR NAV LINK
   ============================================================ */
.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 16px;
    transition: var(--transition);
}

.sidebar-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-nav-link.active {
    background: var(--primary-light);
    color: white;
}

.sidebar.collapsed .sidebar-nav-link .nav-text {
    display: none;
}

.sidebar.collapsed .sidebar-nav-link {
    justify-content: center;
    padding: 12px 8px;
}

/* ============================================================
   API USAGE PAGE STYLES
   ============================================================ */
.api-usage-page {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}

.page-header p {
    color: var(--gray-600);
}

.breadcrumb {
    margin-bottom: 12px;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Summary Cards */
.usage-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
}

.summary-card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.summary-card.highlight .summary-label {
    color: rgba(255, 255, 255, 0.8);
}

.summary-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.summary-card.highlight .summary-value {
    color: white;
}

.summary-label {
    font-size: 13px;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-top: 8px;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
    background: white;
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 140px;
}

.filter-group input[type="date"] {
    min-width: 130px;
}

/* Card component */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    color: var(--primary);
    margin: 0;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
}

/* Model Breakdown */
.model-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.model-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.model-info {
    min-width: 200px;
}

.model-name {
    font-weight: 600;
    color: var(--gray-800);
    display: block;
}

.model-stats {
    font-size: 12px;
    color: var(--gray-500);
}

.model-bar-container {
    flex: 1;
    height: 24px;
    background: var(--gray-100);
    border-radius: var(--radius);
    overflow: hidden;
}

.model-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: var(--radius);
    transition: width 0.3s ease;
}

.model-cost {
    min-width: 80px;
    text-align: right;
    font-weight: 600;
    color: var(--primary);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

.table-info {
    font-size: 13px;
    color: var(--gray-500);
}

#usageTable {
    width: 100%;
    border-collapse: collapse;
}

#usageTable th,
#usageTable td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

#usageTable th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 12px;
    text-transform: uppercase;
}

#usageTable tbody tr:hover {
    background: var(--gray-50);
}

.cost-cell {
    font-weight: 600;
    color: var(--success);
}

.model-badge {
    background: var(--gray-100);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: monospace;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status-success {
    background: #c6f6d5;
    color: #276749;
}

.status-error {
    background: #fed7d7;
    color: #c53030;
}

.status-pending {
    background: #fefcbf;
    color: #975a16;
}

.status-streaming {
    background: #bee3f8;
    color: #2c5282;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.pagination button {
    padding: 8px 16px;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
}

.pagination button:hover {
    background: var(--gray-200);
}

.pagination span {
    color: var(--gray-600);
    font-size: 14px;
}

/* Detail Modal */
.modal-large {
    max-width: 900px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.detail-section {
    background: var(--gray-50);
    padding: 16px;
    border-radius: var(--radius);
}

.detail-section h4 {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.detail-section.error {
    background: #fff5f5;
    border-left: 4px solid var(--danger);
}

.detail-section.error h4 {
    color: var(--danger);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.detail-row span:first-child {
    color: var(--gray-600);
}

.detail-row span:last-child {
    font-weight: 500;
    color: var(--gray-800);
}

.detail-row.total {
    border-top: 2px solid var(--gray-200);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 700;
}

.detail-row.total span:last-child {
    color: var(--success);
    font-size: 16px;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-list li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--gray-200);
    font-size: 13px;
}

.file-list li:last-child {
    border-bottom: none;
}

.file-list small {
    color: var(--gray-500);
}

.response-preview,
.full-response {
    background: var(--gray-800);
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--radius);
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.full-response {
    max-height: 500px;
}

details summary {
    cursor: pointer;
    padding: 8px 0;
    color: var(--primary);
    font-weight: 600;
}

details summary:hover {
    text-decoration: underline;
}

/* Empty state for table */
.empty-state {
    text-align: center;
    padding: 40px !important;
    color: var(--gray-500);
}

/* Responsive */
@media (max-width: 1024px) {
    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .usage-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .model-row {
        flex-wrap: wrap;
    }

    .model-info {
        width: 100%;
        margin-bottom: 8px;
    }

    .model-bar-container {
        flex: 1;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .usage-summary {
        grid-template-columns: 1fr;
    }

    .api-usage-page {
        padding: 16px;
    }
}

/* ============================================================
   ADMIN STYLES
   ============================================================ */

.admin-page {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.page-header-left h1 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}

.page-header-left p {
    color: var(--gray-600);
}

.breadcrumb-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 8px;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.admin-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    position: relative;
    display: block;
}

.admin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.admin-card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.admin-card h3 {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 8px;
}

.admin-card p {
    font-size: 14px;
    color: var(--gray-600);
}

.admin-card-count {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.admin-section {
    margin-top: 32px;
}

.admin-section h2 {
    color: var(--primary);
    margin-bottom: 16px;
}

.stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-box {
    background: white;
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    text-align: center;
    min-width: 150px;
}

.stat-box .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-box .stat-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-top: 4px;
}

.stat-box.highlight {
    background: var(--primary);
}

.stat-box.highlight .stat-value,
.stat-box.highlight .stat-label {
    color: white;
}

/* Template Cards */
.templates-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.template-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

.template-card.is-default {
    border-color: var(--success);
}

.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.template-card h3 {
    font-size: 18px;
    color: var(--primary);
    margin: 0;
}

.default-badge {
    background: var(--success);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.template-description {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 16px;
}

.template-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.template-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Sidebar section label */
.sidebar-section-label {
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    padding: 0 12px;
    margin-bottom: 8px;
    margin-top: 16px;
}

.sidebar.collapsed .sidebar-section-label {
    display: none;
}

/* Form controls */
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    color: var(--primary);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
}

/* Filters bar */
.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
}

/* Table styles */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 12px;
    text-transform: uppercase;
}

table tr:hover {
    background: var(--gray-50);
}

table td.empty,
table td.loading,
table td.error {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
}

table td.error {
    color: var(--danger);
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.status-analyzed {
    background: rgba(56, 161, 105, 0.1);
    color: var(--success);
}

.status-badge.status-draft {
    background: rgba(113, 128, 150, 0.1);
    color: var(--gray-500);
}

/* Small buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state p {
    margin-bottom: 16px;
}

/* Enhanced Analysis Progress */
.progress-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    text-align: center;
}

.progress-header .progress-spinner {
    margin: 0;
}

.progress-header h3 {
    margin: 0;
}

.progress-header p {
    margin: 4px 0 0 0;
    color: var(--gray-600);
}

.progress-bar-container {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-600);
    margin: 0 auto 20px;
    max-width: 400px;
}

.progress-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
}

.progress-details {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 16px 24px;
    margin: 16px auto;
    max-height: 200px;
    overflow-y: auto;
    max-width: 500px;
    text-align: left;
}

.progress-details p {
    margin: 8px 0;
    font-size: 13px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   API USAGE DETAIL LOG STYLES
   ============================================================ */
.log-details {
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.log-summary {
    padding: 10px 14px;
    background: var(--gray-50);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-summary:hover {
    background: var(--gray-100);
}

.char-count {
    color: var(--gray-500);
    font-size: 0.85em;
    font-weight: normal;
}

.log-content {
    padding: 12px 14px;
    max-height: 400px;
    overflow: auto;
    background: var(--gray-900);
    color: var(--gray-100);
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-content.system-prompt {
    background: #1e3a5f;
}

.log-content.response-text {
    background: #1a2e1a;
}

.doc-refs {
    background: #eff6ff;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 12px;
    color: var(--gray-800);
}

.doc-refs ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.text-prompts {
    margin-top: 12px;
    color: var(--gray-100);
}

.user-prompt {
    background: var(--gray-800);
    color: var(--gray-100);
    padding: 12px;
    border-radius: 4px;
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow: auto;
}

.raw-json {
    background: var(--gray-800);
    color: var(--gray-300);
    padding: 12px;
    font-size: 12px;
    max-height: 300px;
    overflow: auto;
}

.error-text {
    background: #3d1c1c;
    color: #fca5a5;
}

.log-meta {
    color: var(--gray-500);
    margin-bottom: 12px;
}

.full-log-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.full-log-section h4 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 8px;
}

.detail-section.warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 12px;
}

.detail-section.warning h4 {
    color: #92400e;
}

.detail-section.info {
    background: #eff6ff;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    padding: 12px;
}

.detail-section.info h4 {
    color: #1e40af;
}

/* ============================================================
   PROGRESSIVE DISCLOSURE STYLES
   ============================================================ */
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--gray-100); }

/* Detail Modal Grid */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.detail-section { background: var(--gray-50); padding: 16px; border-radius: var(--radius); }
.detail-section h4 { font-size: 12px; text-transform: uppercase; color: var(--gray-500); margin-bottom: 12px; border-bottom: 1px solid var(--gray-200); padding-bottom: 8px; }
.detail-section.alert-section { background: #fef3c7; border-left: 3px solid var(--warning); }
.detail-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.detail-row span:first-child { color: var(--gray-500); }
.detail-row.full-width { flex-direction: column; }
.detail-row.full-width span:first-child { margin-bottom: 4px; font-weight: 600; }

/* Part Number / Manufacturer Subtle Display */
.part-number { color: var(--info); font-family: monospace; }
.manufacturer { color: var(--gray-500); font-style: italic; }
.drawing-ref { color: var(--gray-500); }

/* Toggle Columns */
.extended-col, .xfmr-ext, .cable-ext { transition: var(--transition); }

/* Calculation Tables */
.calc-table { font-size: 12px; margin-top: 8px; }
.calc-table th { background: var(--gray-200); color: var(--gray-700); padding: 6px 10px; }
.calc-table td { padding: 6px 10px; }
.calc-category { margin-bottom: 16px; }
.calc-category h5 { font-size: 13px; color: var(--primary); margin-bottom: 8px; }

/* ============================================================
   ROUTING CODE CARDS
   ============================================================ */
.routing-codes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.routing-code-card { padding: 12px; background: var(--gray-50); border-radius: var(--radius); border-left: 4px solid var(--primary); }
.routing-code-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.routing-code-id { font-weight: 700; font-size: 16px; color: var(--primary); }
.routing-code-voltage { font-size: 12px; background: var(--primary); color: white; padding: 2px 8px; border-radius: var(--radius-sm); }
.routing-code-details { font-size: 11px; color: var(--gray-500); margin-top: 6px; }
.routing-code-details span { display: inline-block; margin-right: 12px; }

/* ============================================================
   MANUFACTURER CARDS
   ============================================================ */
.manufacturers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.manufacturer-card { padding: 16px; background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); }
.manufacturer-name { font-weight: 700; color: var(--primary); font-size: 15px; margin-bottom: 4px; }
.manufacturer-id { font-size: 11px; color: var(--gray-500); }
.manufacturer-products { font-size: 13px; margin: 8px 0; }
.manufacturer-categories { margin-top: 8px; }
.category-tag { display: inline-block; background: var(--gray-100); padding: 2px 8px; border-radius: var(--radius-sm); font-size: 11px; margin-right: 4px; margin-bottom: 4px; }

/* ============================================================
   RFI ENHANCEMENTS
   ============================================================ */
.rfi-category { font-size: 11px; background: var(--gray-100); padding: 3px 8px; border-radius: var(--radius-sm); margin-left: 8px; }
.rfi-status-badge { font-size: 11px; padding: 3px 10px; border-radius: 12px; }
.rfi-status-badge.status-pending { background: var(--gray-200); color: var(--gray-700); }
.rfi-status-badge.status-resolved { background: #c6f6d5; color: #276749; }
.rfi-suggestion { background: #e8f4fd; padding: 12px; border-radius: var(--radius); margin-top: 12px; }
.confidence-bar { display: inline-block; width: 60px; height: 6px; background: var(--gray-200); border-radius: 3px; vertical-align: middle; margin: 0 6px; }
.confidence-fill { display: block; height: 100%; background: var(--success); border-radius: 3px; }

/* Affects Quote Highlight */
.affects-quote { background: linear-gradient(to right, rgba(229, 62, 62, 0.1), transparent); border-left: 3px solid var(--danger); }

/* Cable Spec Badge */
.cable-spec-badge { background: var(--info); color: white; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 11px; margin-left: 8px; }

/* ============================================================
   DRAWING TAGS
   ============================================================ */
.drawing-grid, .drawings-list { display: flex; flex-wrap: wrap; gap: 8px; }
.drawing-tag { background: var(--gray-100); padding: 4px 10px; border-radius: var(--radius-sm); font-size: 12px; font-family: monospace; }
.drawing-tag.missing { background: #fef3c7; color: #92400e; }

/* ============================================================
   TOPOLOGY BADGES
   ============================================================ */
.topology-badge { padding: 3px 10px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; }
.topology-badge.topology-loop { background: #c6f6d5; color: #276749; }
.topology-badge.topology-radial { background: #bee3f8; color: #2c5282; }
.topology-badge.topology-ring { background: #e9d8fd; color: #553c9a; }
.topology-badge.topology-chain { background: #fefcbf; color: #975a16; }

/* ============================================================
   CABLE WORKING CARDS
   ============================================================ */
.cable-working-card { background: var(--gray-50); padding: 12px; border-radius: var(--radius); margin-bottom: 12px; }
.working-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.working-result { background: var(--primary); color: white; padding: 2px 10px; border-radius: var(--radius-sm); font-size: 12px; }
.working-calc { background: white; padding: 8px; border-radius: var(--radius-sm); margin-top: 8px; }
.working-calc code { font-size: 12px; color: var(--primary); }
.segments-table { font-size: 11px; margin-top: 8px; }
.segments-table th, .segments-table td { padding: 4px 8px; }

/* ============================================================
   AUDIT SECTION
   ============================================================ */
.audit-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; padding: 12px; background: var(--gray-50); border-radius: var(--radius); }
.audit-meta-item { display: flex; gap: 8px; }
.audit-meta-item .label { color: var(--gray-500); }
.audit-meta-item .value { font-weight: 600; }
.audit-drawings { margin-top: 8px; }
.audit-section { margin-top: 20px; }
.audit-section h4 { font-size: 14px; color: var(--primary); margin-bottom: 12px; }

/* ============================================================
   BRIDGING POWER
   ============================================================ */
.bp-section { margin-bottom: 16px; }
.bp-section h5 { font-size: 13px; color: var(--gray-700); margin-bottom: 8px; }
.bp-steps { padding-left: 20px; }
.bp-steps li { margin-bottom: 6px; }

/* ============================================================
   TOPOLOGY GRID
   ============================================================ */
.topology-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.topology-card { padding: 12px; background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); }
.topology-circuit { font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.topology-classification { margin-bottom: 8px; }
.topology-pattern, .topology-evidence, .topology-notes { margin-top: 6px; }
