/* ============================================
   MCP Analytics — Account Page Styles
   Extracted from inline styles + sidebar layout
   ============================================ */

/* --- Font faces --- */
@font-face {
    font-family: 'Geist';
    src: url('../fonts/Geist-VariableFont_wght.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}
@font-face {
    font-family: 'Geist Mono';
    src: url('../fonts/GeistMono-VariableFont_wght.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

/* --- Reset & Base --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-primary {
    background: #ff7b00;
    color: #fff;
}
.btn-primary:hover { background: #e86e00; }
.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: #e0e0e0;
    border: 1px solid rgba(255,255,255,0.12);
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); }
.btn-danger {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.25);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-icon-only {
    min-width: auto;
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- States --- */
.state { display: none; }
.state.active { display: block; }

/* --- Loading --- */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 1rem;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,123,0,0.2);
    border-top-color: #ff7b00;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Login --- */
.login-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    gap: 0;
    text-align: center;
    padding: 2rem;
}
.login-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 100%;
}
.login-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,123,0,0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.4rem;
}
.login-card h1 {
    font-size: 1.35rem;
    color: #fff;
    margin-bottom: 0.5rem;
}
.login-card .login-subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
    line-height: 1.5;
}
.login-card .btn-primary {
    width: 100%;
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}
.login-features {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 1.25rem;
    text-align: left;
}
.login-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.login-features li {
    font-size: 0.82rem;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.login-features li::before {
    content: '\2713';
    color: #ff7b00;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* --- Error --- */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 1rem;
    text-align: center;
}
.error-state h2 { color: #ef4444; }
.error-state p { color: #a0a0a0; max-width: 500px; }

/* ============================================
   Sidebar + Content Layout
   ============================================ */

.account-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 80px);
}

/* --- Sidebar --- */
.account-sidebar {
    background: #0c0c14;
    border-right: 1px solid rgba(255,255,255,0.06);
    padding: 1.75rem 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 40;
}

.account-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255,123,0,0.12) 30%,
        rgba(255,123,0,0.06) 70%,
        transparent 100%
    );
    z-index: 1;
    pointer-events: none;
}

.sidebar-header {
    padding: 0 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 0.5rem;
}

.sidebar-user-email {
    font-size: 0.78rem;
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Geist Mono', monospace;
    letter-spacing: -0.01em;
}

.sidebar-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0.2rem 0.55rem;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255,123,0,0.1);
    color: #ff7b00;
    border: 1px solid rgba(255,123,0,0.15);
}

.sidebar-tier-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ff7b00;
    box-shadow: 0 0 6px rgba(255,123,0,0.5);
}

/* Sidebar navigation */
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1.25rem;
    margin: 0.125rem 0.5rem;
    border-radius: 8px;
    color: #4b5563;
    font-size: 0.875rem;
    font-weight: 450;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
    border: 1px solid transparent;
    -webkit-user-select: none;
    user-select: none;
}

.sidebar-nav-item:hover {
    color: #c0c0c0;
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.04);
}

.sidebar-nav-item.active {
    color: #f0f0f0;
    background: rgba(255,123,0,0.06);
    border-color: rgba(255,123,0,0.12);
    font-weight: 500;
}

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 2px 2px 0;
    background: #ff7b00;
    box-shadow: 0 0 8px rgba(255,123,0,0.3);
}

.sidebar-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.sidebar-nav-item:hover svg {
    opacity: 0.7;
}

.sidebar-nav-item.active svg {
    opacity: 1;
    stroke: #ff7b00;
}

.sidebar-nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar bottom */
.sidebar-bottom {
    padding: 0.5rem 0;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.sidebar-nav-item.signout {
    color: #555;
    font-size: 0.82rem;
}

.sidebar-nav-item.signout:hover {
    color: #ef4444;
    background: rgba(239,68,68,0.05);
    border-color: rgba(239,68,68,0.08);
}

.sidebar-nav-item.signout:hover svg {
    stroke: #ef4444;
    opacity: 0.8;
}

/* --- Content Area --- */
.account-content {
    padding: 2rem 2.5rem 4rem;
    width: 100%;
    overflow-x: hidden;
}

.account-content-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

/* --- Mobile Hamburger --- */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 60;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(255,123,0,0.25);
    background: #13131a;
    color: #ff7b00;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,123,0,0.08);
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: #1a1a24;
    border-color: rgba(255,123,0,0.4);
    box-shadow: 0 4px 24px rgba(0,0,0,0.6), 0 0 12px rgba(255,123,0,0.15);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 49;
}

.sidebar-overlay.open {
    display: block;
}

/* Sidebar scrollbar */
.account-sidebar::-webkit-scrollbar { width: 4px; }
.account-sidebar::-webkit-scrollbar-track { background: transparent; }
.account-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

/* ============================================
   Cards
   ============================================ */

.card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.card-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 1rem;
}

/* Plan card */
.plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.plan-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}
.plan-price {
    font-family: 'Geist Mono', monospace;
    font-size: 1.1rem;
    color: #ff7b00;
}
.plan-status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.plan-status.active {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}
.plan-status.canceled {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}
.plan-status.trialing {
    background: rgba(59,130,246,0.15);
    color: #3b82f6;
}
.plan-status.none {
    background: rgba(255,255,255,0.06);
    color: #888;
}

/* Usage bar */
.usage-bar-container {
    margin-top: 0.75rem;
}
.usage-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #a0a0a0;
    margin-bottom: 0.4rem;
}
.usage-bar {
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}
.usage-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    background: #ff7b00;
}
.usage-bar-fill.warning { background: #eab308; }
.usage-bar-fill.danger { background: #ef4444; }

/* Period info */
.period-info {
    font-size: 0.8rem;
    color: #4b5563;
    margin-top: 0.5rem;
}

/* ============================================
   AI Model selector
   ============================================ */

.model-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.model-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.model-option:hover {
    border-color: rgba(255,123,0,0.3);
    background: rgba(255,255,255,0.02);
}
.model-option.selected {
    border-color: #ff7b00;
    background: rgba(255,123,0,0.06);
}
.model-option input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}
.model-option.selected input[type="radio"] {
    border-color: #ff7b00;
}
.model-option.selected input[type="radio"]::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    background: #ff7b00;
    border-radius: 50%;
}
.model-info { flex: 1; }
.model-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
}
.model-desc {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.2rem;
}
.model-price {
    font-family: 'Geist Mono', monospace;
    font-size: 0.85rem;
    color: #ff7b00;
    white-space: nowrap;
}
.model-price.included {
    color: #22c55e;
}

/* ============================================
   Confirm dialog
   ============================================ */

.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.confirm-overlay.active {
    display: flex;
}
.confirm-dialog {
    background: #1a1a24;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
}
.confirm-dialog h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}
.confirm-dialog p {
    color: #a0a0a0;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.confirm-dialog .proration-amount {
    font-family: 'Geist Mono', monospace;
    color: #ff7b00;
    font-weight: 600;
}
.confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ============================================
   Actions row
   ============================================ */

.actions-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ============================================
   Toast
   ============================================ */

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    z-index: 300;
    transition: transform 0.3s ease;
    max-width: 90%;
}
.toast.visible { transform: translateX(-50%) translateY(0); }
.toast.success {
    background: rgba(34,197,94,0.15);
    border: 1px solid rgba(34,197,94,0.3);
    color: #22c55e;
}
.toast.error {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
}

/* ============================================
   Dataset Management
   ============================================ */

.datasets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.datasets-count {
    font-family: 'Geist Mono', monospace;
    font-size: 0.7rem;
    color: #ff7b00;
    background: rgba(255,123,0,0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255,123,0,0.15);
}

/* Dataset Filters */
.dataset-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.filter-chip {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    color: #a0a0a0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.filter-chip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,123,0,0.1), rgba(255,123,0,0.05));
    opacity: 0;
    transition: opacity 0.2s;
}
.filter-chip:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,123,0,0.2);
    transform: translateY(-1px);
}
.filter-chip:hover::before {
    opacity: 1;
}
.filter-chip.active {
    background: linear-gradient(135deg, rgba(255,123,0,0.15), rgba(255,123,0,0.08));
    border-color: rgba(255,123,0,0.4);
    color: #ff7b00;
    box-shadow: 0 0 0 1px rgba(255,123,0,0.1), 0 2px 8px rgba(255,123,0,0.15);
}
.filter-chip.active::after {
    content: '\00d7';
    margin-left: 0.4rem;
    opacity: 0.7;
}

/* Dataset Container */
.datasets-container {
    position: relative;
}
.datasets-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}
.datasets-list::-webkit-scrollbar { width: 6px; }
.datasets-list::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 3px; }
.datasets-list::-webkit-scrollbar-thumb { background: rgba(255,123,0,0.3); border-radius: 3px; }
.datasets-list::-webkit-scrollbar-thumb:hover { background: rgba(255,123,0,0.5); }

/* Dataset Row */
.dataset-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}
.dataset-row::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,123,0,0.08), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}
.dataset-row::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #ff7b00, rgba(255,123,0,0.3));
    opacity: 0;
    transition: opacity 0.3s;
}
.dataset-row:hover {
    border-color: rgba(255,123,0,0.25);
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,123,0,0.1);
}
.dataset-row:hover::before { opacity: 1; }
.dataset-row:hover::after { opacity: 1; }
.dataset-row.dataset-demo {
    background: linear-gradient(135deg, rgba(59,130,246,0.03), rgba(59,130,246,0.01));
    border-color: rgba(59,130,246,0.15);
}
.dataset-row.dataset-demo::after {
    background: linear-gradient(180deg, #3b82f6, rgba(59,130,246,0.3));
}

/* Dataset Info */
.dataset-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255,123,0,0.12), rgba(255,123,0,0.06));
    border: 1px solid rgba(255,123,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}
.dataset-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15), transparent);
}
.dataset-info {
    flex: 1;
    min-width: 0;
}
.dataset-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dataset-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Geist Mono', monospace;
    font-size: 0.7rem;
    color: #4b5563;
}
.dataset-meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.dataset-meta-item svg {
    width: 11px;
    height: 11px;
    opacity: 0.5;
}
.dataset-meta-value {
    color: #888;
}

/* Dataset Tags */
.dataset-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.dataset-tag {
    font-family: 'Geist Mono', monospace;
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255,123,0,0.08);
    color: #ff9f4d;
    border: 1px solid rgba(255,123,0,0.15);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.dataset-tag.tag-demo {
    background: rgba(59,130,246,0.08);
    color: #60a5fa;
    border-color: rgba(59,130,246,0.15);
}

/* Dataset Actions */
.dataset-actions {
    display: flex;
    gap: 0.4rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.dataset-row:hover .dataset-actions {
    opacity: 1;
}
.dataset-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}
.dataset-action-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,123,0,0.3);
    color: #ff7b00;
    transform: scale(1.1);
}
.dataset-action-btn.delete:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
    color: #ef4444;
}

/* Empty State */
.datasets-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #4b5563;
}
.datasets-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    opacity: 0.5;
}
.datasets-empty h3 {
    font-size: 1rem;
    color: #888;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.datasets-empty p {
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* ============================================
   Edit Modal
   ============================================ */

.edit-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    z-index: 250;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}
.edit-overlay.active {
    display: flex;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.edit-dialog {
    background: #13131a;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 2rem;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.edit-dialog h3 {
    color: #fff;
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}
.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #a0a0a0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-input,
.form-textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.form-input:focus,
.form-textarea:focus {
    outline: none;
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,123,0,0.4);
    box-shadow: 0 0 0 3px rgba(255,123,0,0.1);
}
.form-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}
.edit-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.75rem;
}

/* ============================================
   Overview Dashboard Grid
   ============================================ */

.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.overview-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}
.overview-card.clickable {
    cursor: pointer;
}
.overview-card.clickable:hover {
    border-color: rgba(255,123,0,0.3);
    background: rgba(255,255,255,0.04);
}
.overview-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}
.overview-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.overview-card-icon.plan { background: rgba(255,123,0,0.1); color: #ff7b00; }
.overview-card-icon.plan svg { stroke: #ff7b00; }
.overview-card-icon.usage { background: rgba(59,130,246,0.1); color: #3b82f6; }
.overview-card-icon.usage svg { stroke: #3b82f6; }
.overview-card-icon.model { background: rgba(168,85,247,0.1); color: #a855f7; }
.overview-card-icon.model svg { stroke: #a855f7; }
.overview-card-icon.stats { background: rgba(34,197,94,0.1); color: #22c55e; }
.overview-card-icon.stats svg { stroke: #22c55e; }
.overview-card-icon.modules { background: rgba(6,182,212,0.1); color: #06b6d4; }
.overview-card-icon.modules svg { stroke: #06b6d4; }
.overview-card-icon.datasets { background: rgba(234,179,8,0.1); color: #eab308; }
.overview-card-icon.datasets svg { stroke: #eab308; }
.overview-card-icon.connectors { background: rgba(244,114,182,0.1); color: #f472b6; }
.overview-card-icon.connectors svg { stroke: #f472b6; }

.overview-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
}
.overview-card-body { }
.overview-plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.overview-plan-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}
.overview-price {
    font-family: 'Geist Mono', monospace;
    font-size: 0.9rem;
    color: #ff7b00;
    margin-bottom: 0.2rem;
}
.overview-detail {
    font-size: 0.78rem;
    color: #4b5563;
    margin-top: 0.15rem;
}
.overview-usage-num {
    margin-bottom: 0.5rem;
}
.overview-usage-current {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}
.overview-usage-sep {
    font-size: 0.85rem;
    color: #888;
}
.overview-model-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}
.overview-model-price {
    font-family: 'Geist Mono', monospace;
    font-size: 0.8rem;
    color: #ff7b00;
}
.overview-model-price.included {
    color: #22c55e;
}
.overview-link {
    font-size: 0.75rem;
    color: #ff7b00;
    margin-top: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.overview-card.clickable:hover .overview-link { opacity: 1; }

.overview-stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.overview-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.overview-stat-label {
    font-size: 0.82rem;
    color: #888;
}
.overview-stat-value {
    font-family: 'Geist Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0e0e0;
}

/* ============================================
   AI Model — Enhancements
   ============================================ */

.model-intro {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}
.model-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.model-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.model-badge.current {
    background: rgba(255,123,0,0.12);
    color: #ff7b00;
    border: 1px solid rgba(255,123,0,0.2);
}
.model-badge.popular {
    background: rgba(59,130,246,0.1);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.2);
}
.model-features {
    list-style: none;
    padding: 0;
    margin: 0.6rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.model-features li {
    font-size: 0.75rem;
    color: #4b5563;
    padding-left: 1rem;
    position: relative;
}
.model-features li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: rgba(255,123,0,0.5);
    font-size: 0.7rem;
    font-weight: 700;
}

/* ============================================
   Dataset Table
   ============================================ */

.datasets-table-wrap {
    overflow-x: auto;
    margin: 0 -0.25rem;
}
.ds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.ds-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4b5563;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
    user-select: none;
}
.ds-table th.ds-sortable {
    cursor: pointer;
    transition: color 0.15s;
}
.ds-table th.ds-sortable:hover { color: #aaa; }
.ds-table th.ds-sorted { color: #ff7b00; }

.ds-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: #c0c0c0;
    vertical-align: middle;
}
.ds-table tr:hover td {
    background: rgba(255,255,255,0.02);
}
.ds-table tr.ds-row-demo td {
    background: rgba(59,130,246,0.02);
}
.ds-table tr.ds-row-demo:hover td {
    background: rgba(59,130,246,0.04);
}

.ds-cell-name {
    font-weight: 500;
    color: #e0e0e0;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ds-name-text {
    vertical-align: middle;
}
.ds-demo-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FF7B00;
    margin-right: 0.5rem;
    vertical-align: middle;
}
.ds-cell-num {
    font-family: 'Geist Mono', monospace;
    font-size: 0.8rem;
    color: #636b74;
    white-space: nowrap;
}
.ds-cell-cat { white-space: nowrap; }
.ds-cat-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(255,123,0,0.08);
    color: #ff9f4d;
    border: 1px solid rgba(255,123,0,0.12);
    text-transform: lowercase;
}
.ds-cat-none {
    color: #444;
}
.ds-cell-date {
    font-size: 0.8rem;
    color: #888;
    white-space: nowrap;
}
.ds-cell-actions {
    text-align: right;
    white-space: nowrap;
}
.ds-cell-actions .dataset-action-btn {
    opacity: 0.4;
    transition: opacity 0.15s;
}
.ds-table tr:hover .ds-cell-actions .dataset-action-btn {
    opacity: 1;
}
.ds-protected {
    color: #555;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

/* ============================================
   Reports
   ============================================ */

.reports-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.reports-count { background: rgba(255,123,0,0.15); color: #ff7b00; font-size: 0.72rem; font-weight: 600; padding: 0.12rem 0.45rem; border-radius: 99px; }

/* Toolbar: search + pills inline */
.rpt-toolbar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.rpt-search-wrap { position: relative; flex: 0 0 180px; }
.rpt-search-icon { position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); color: #555; pointer-events: none; }
.rpt-search-input { width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 0.4rem 0.6rem 0.4rem 2rem; color: #ccc; font-size: 0.78rem; outline: none; box-sizing: border-box; }
.rpt-search-input:focus { border-color: rgba(255,123,0,0.4); }
.rpt-search-input::placeholder { color: #444; }
.rpt-date-select { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 0.35rem 0.5rem; color: #aaa; font-size: 0.75rem; outline: none; cursor: pointer; appearance: auto; }
.rpt-date-select:focus { border-color: rgba(255,123,0,0.4); }
.rpt-date-select option { background: #1a1a1f; color: #ccc; }
.rpt-status-filters { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.rpt-status-pill { font-size: 0.7rem; padding: 0.2rem 0.55rem; border-radius: 99px; border: 1px solid rgba(255,255,255,0.08); color: #666; cursor: pointer; transition: all 0.15s; user-select: none; }
.rpt-status-pill:hover { border-color: rgba(255,255,255,0.15); color: #999; }
.rpt-status-pill.active { background: rgba(255,123,0,0.1); border-color: rgba(255,123,0,0.25); color: #ff7b00; }
.rpt-pill-n { font-weight: 600; margin-left: 0.15rem; }

/* Main layout */
.rpt-main { display: flex; border-top: 1px solid rgba(255,255,255,0.06); min-height: 500px; }
.rpt-list-col { flex: 0 0 220px; overflow-y: auto; max-height: calc(100vh - 260px); background: rgba(0,0,0,0.12); border-right: 1px solid rgba(255,255,255,0.06); }
.rpt-detail-col { flex: 1 1 auto; overflow-y: auto; max-height: calc(100vh - 260px); display: flex; flex-direction: column; }

/* List */
.rpt-list-header { display: flex; position: sticky; top: 0; z-index: 1; background: rgba(10,10,15,0.95); border-bottom: 1px solid rgba(255,255,255,0.06); }
.rpt-lh { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #555; padding: 0.4rem 0.5rem; cursor: pointer; user-select: none; white-space: nowrap; }
.rpt-lh:hover { color: #999; }
.rpt-lh-sorted { color: #ff7b00 !important; }
.rpt-lh-name { flex: 1 1 auto; }
.rpt-lh-date { flex: 0 0 40px; text-align: right; }
.rpt-list-row { display: flex; align-items: center; padding: 0.45rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.03); cursor: pointer; transition: background 0.1s; }
.rpt-list-row:hover { background: rgba(255,255,255,0.04); }
.rpt-list-row.selected { background: rgba(255,123,0,0.08); border-left: 3px solid #ff7b00; padding-left: calc(0.5rem - 3px); }
.rpt-lr-name { flex: 1 1 auto; font-size: 0.75rem; font-weight: 500; color: #bbb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; display: flex; align-items: center; gap: 0.35rem; }
.rpt-lr-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.rpt-dot-success { background: #22c55e; }
.rpt-dot-error { background: #ef4444; }
.rpt-dot-running { background: #fbbf24; }
.rpt-lr-date { flex: 0 0 auto; font-size: 0.68rem; color: #444; white-space: nowrap; }
.rpt-no-match { text-align: center; padding: 2rem; color: #555; font-size: 0.82rem; }

/* Status badges */
.rpt-badge { display: inline-block; font-size: 0.62rem; font-weight: 600; padding: 0.1rem 0.4rem; border-radius: 4px; text-transform: capitalize; }
.rpt-badge-success { background: rgba(34,197,94,0.15); color: #22c55e; }
.rpt-badge-error { background: rgba(239,68,68,0.15); color: #ef4444; }
.rpt-badge-running { background: rgba(251,191,36,0.15); color: #fbbf24; }

/* Detail panel: top section */
.rpt-detail-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; color: #333; gap: 0.5rem; }
.rpt-detail-placeholder p { font-size: 0.78rem; margin: 0; }
.rpt-detail-top { padding: 1rem 1.25rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.rpt-dt-title { font-size: 1rem; font-weight: 600; color: #e0e0e0; margin-bottom: 0.35rem; }
.rpt-dt-meta { font-size: 0.75rem; color: #666; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.rpt-dt-sep { color: #333; }
.rpt-dt-btns { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.rpt-dt-btns .btn-sm { font-size: 0.72rem; padding: 0.3rem 0.6rem; display: inline-flex; align-items: center; }

/* Metrics pills */
.rpt-metrics { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.rpt-metric { display: flex; flex-direction: column; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 5px; padding: 0.3rem 0.5rem; }
.rpt-metric-label { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.03em; color: #555; margin-bottom: 0.1rem; }
.rpt-metric-value { font-size: 0.78rem; font-weight: 600; color: #ddd; font-variant-numeric: tabular-nums; }

/* Card strip (tab selector) */
.rpt-card-strip { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; background: rgba(0,0,0,0.1); }
.rpt-strip-item { display: flex; align-items: center; gap: 0.3rem; padding: 0.5rem 0.75rem; font-size: 0.72rem; color: #666; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; transition: all 0.12s; flex-shrink: 0; }
.rpt-strip-item:hover { color: #aaa; background: rgba(255,255,255,0.02); }
.rpt-strip-item.active { color: #ff7b00; border-bottom-color: #ff7b00; background: rgba(255,123,0,0.04); }
.rpt-strip-item svg { opacity: 0.5; }
.rpt-strip-item.active svg { opacity: 1; stroke: #ff7b00; }

/* Card view (single card) */
.rpt-card-view { flex: 1; overflow-y: auto; padding: 1.25rem; }
.rpt-cv-title { font-size: 0.95rem; font-weight: 600; color: #ddd; margin-bottom: 0.6rem; }

/* Collapsible insight */
.rpt-cv-insight-wrap { margin-top: 1rem; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 0.75rem; }
.rpt-cv-insight-toggle { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; user-select: none; color: #888; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.5rem; }
.rpt-cv-insight-toggle:hover { color: #bbb; }
.rpt-cv-chevron { transition: transform 0.2s; }
.rpt-cv-insight-wrap.open .rpt-cv-chevron { transform: rotate(0deg); }
.rpt-cv-insight-wrap:not(.open) .rpt-cv-chevron { transform: rotate(-90deg); }
.rpt-cv-insight-body { font-size: 0.82rem; color: #999; line-height: 1.6; }
.rpt-cv-insight-wrap:not(.open) .rpt-cv-insight-body { display: none; }
.rpt-cv-insight-body p { margin: 0 0 0.6rem; }
.rpt-cv-insight-body p:last-child { margin-bottom: 0; }
.rpt-cv-insight-body .rpt-insight-heading { font-weight: 600; color: #aaa; font-size: 0.78rem; margin-bottom: 0.3rem; }
.rpt-cv-insight-body .rpt-insight-bullet { padding-left: 1rem; color: #888; }
.rpt-cv-plot { margin: 0.75rem 0; border-radius: 6px; overflow: hidden; }
.rpt-cv-table-wrap { overflow-x: auto; margin: 0.75rem 0; }
.rpt-cv-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.rpt-cv-table th { text-align: left; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; color: #555; padding: 0.4rem 0.6rem; border-bottom: 1px solid rgba(255,255,255,0.08); white-space: nowrap; }
.rpt-cv-table td { padding: 0.35rem 0.6rem; color: #aaa; border-bottom: 1px solid rgba(255,255,255,0.03); font-variant-numeric: tabular-nums; }
.rpt-cv-table tr:hover td { background: rgba(255,255,255,0.02); }

.rpt-cards-loading { display: flex; align-items: center; gap: 0.5rem; color: #555; font-size: 0.8rem; padding: 1rem; }
.rpt-cards-unavailable { color: #444; font-size: 0.8rem; padding: 1rem; }

/* Spinner */
.spinner-sm { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.2); border-top-color: #ff7b00; border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Detail module footer */
.rpt-detail-module { font-size: 0.7rem; color: #333; font-family: var(--font-mono, monospace); padding: 0.5rem 0; margin-top: auto; }

/* Empty state */
.reports-empty {
    text-align: center;
    padding: 3rem 1.5rem;
}
.reports-empty-icon {
    color: #333;
    margin-bottom: 1rem;
}
.reports-empty h3 {
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}
.reports-empty p {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 800px) {
    .rpt-main { flex-direction: column; }
    .rpt-list-col { flex: none; max-height: 180px; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
    .rpt-detail-col { flex: none; max-height: none; }
    .rpt-toolbar { flex-direction: column; }
    .rpt-search-wrap { flex: 1 1 100%; }
}

/* ============================================
   Connectors
   ============================================ */

.conn-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    margin-bottom: 0.6rem;
    padding-left: 0.25rem;
}

.conn-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    background: rgba(255,255,255,0.015);
}
.conn-row:hover {
    border-color: rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.03);
}
/* (conn-row-system removed — no system connections on account page) */

.conn-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.conn-dot-green { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.conn-dot-yellow { background: #eab308; box-shadow: 0 0 6px rgba(234,179,8,0.3); }
.conn-dot-red { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.3); }

.conn-info { flex: 1; min-width: 0; }
.conn-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.conn-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e0e0e0;
    font-family: 'Geist Mono', monospace;
}
.conn-type {
    font-size: 0.75rem;
    color: #888;
}
.conn-meta {
    font-size: 0.75rem;
    color: #555;
    margin-top: 0.2rem;
    font-family: 'Geist Mono', monospace;
}

.conn-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}
/* (conn-system-label removed — no system connections on account page) */
.conn-cred-ok {
    font-size: 0.7rem;
    color: #22c55e;
    margin-right: 0.25rem;
}
.conn-empty-user {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #555;
    font-size: 0.85rem;
}

/* Connector Modal */
.connector-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    z-index: 250;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}
.connector-overlay.active {
    display: flex;
}
.connector-dialog {
    background: #13131a;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 2rem;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.connector-dialog h3 {
    color: #fff;
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
    font-weight: 600;
}
.conn-modal-subtitle {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
}

/* Connector type search in modal */
.conn-type-search {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.85rem;
    font-family: 'Geist', sans-serif;
    margin-bottom: 0.75rem;
    outline: none;
    transition: border-color 0.15s;
}
.conn-type-search:focus {
    border-color: rgba(255,123,0,0.4);
}
.conn-type-search::placeholder {
    color: #555;
}

/* Connector type cards in modal */
.conn-type-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    max-height: 320px;
    overflow-y: auto;
}
.conn-type-card {
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.conn-type-card:hover {
    border-color: rgba(255,123,0,0.25);
    background: rgba(255,255,255,0.02);
}
.conn-type-card.selected {
    border-color: #ff7b00;
    background: rgba(255,123,0,0.06);
}
.conn-type-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e0e0e0;
}
.conn-type-meta {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.15rem;
}
.conn-type-desc {
    font-size: 0.75rem;
    color: #4b5563;
    margin-top: 0.25rem;
    line-height: 1.35;
}
.conn-type-streams {
    font-size: 0.7rem;
    color: #4b5563;
    margin-top: 0.25rem;
    font-family: 'Geist Mono', monospace;
}
.conn-type-card.hidden {
    display: none;
}
.conn-config-help {
    font-size: 0.7rem;
    color: #4b5563;
    margin-top: 0.3rem;
}

/* Credential setup guide */
.conn-creds-guide {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}
.conn-creds-guide-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}
.conn-creds-steps {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.8rem;
    color: #636b74;
    line-height: 1.65;
}
.conn-creds-steps li {
    margin-bottom: 0.15rem;
}
.conn-creds-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: #ff7b00;
    text-decoration: none;
    transition: color 0.15s;
}
.conn-creds-link:hover {
    color: #ff9933;
}

/* File upload dropzone */
.conn-dropzone {
    border: 2px dashed rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.75rem;
}
.conn-dropzone:hover {
    border-color: rgba(255,123,0,0.3);
    background: rgba(255,123,0,0.02);
}
.conn-dropzone.dragover {
    border-color: #ff7b00;
    background: rgba(255,123,0,0.06);
}
.conn-dropzone.success {
    border-color: rgba(34,197,94,0.3);
    background: rgba(34,197,94,0.03);
}
.conn-dropzone.error {
    border-color: rgba(255,68,68,0.3);
    background: rgba(255,68,68,0.03);
}
.conn-dropzone-icon {
    margin-bottom: 0.5rem;
    opacity: 0.5;
}
.conn-dropzone.success .conn-dropzone-icon,
.conn-dropzone.error .conn-dropzone-icon {
    opacity: 1;
}
.conn-dropzone-label {
    font-size: 0.85rem;
    color: #bbb;
    margin: 0 0 0.2rem;
}
.conn-dropzone-sublabel {
    font-size: 0.75rem;
    color: #4b5563;
    margin: 0;
}

/* Identity confirmation after file upload */
.conn-creds-identity {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #aaa;
    padding: 0.5rem 0.75rem;
    background: rgba(34,197,94,0.05);
    border: 1px solid rgba(34,197,94,0.15);
    border-radius: 6px;
}
.conn-creds-identity strong {
    color: #ddd;
    font-family: 'Geist Mono', monospace;
    font-size: 0.78rem;
}

/* Category tabs in type selector */
.conn-category-tabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.conn-category-tab {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-family: 'Geist', sans-serif;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
}
.conn-category-tab:hover {
    border-color: rgba(255,123,0,0.3);
    color: #bbb;
}
.conn-category-tab.active {
    border-color: #ff7b00;
    background: rgba(255,123,0,0.1);
    color: #ff7b00;
}
.conn-category-count {
    font-size: 0.65rem;
    color: #4b5563;
    margin-left: 0.25rem;
}
.conn-category-tab.active .conn-category-count {
    color: rgba(255,123,0,0.6);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .account-layout {
        grid-template-columns: 1fr;
    }

    .account-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 50;
        box-shadow: none;
    }

    .account-sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(0,0,0,0.5);
    }

    .sidebar-toggle {
        display: flex;
    }

    .account-content {
        padding: 1.5rem 1rem 5rem;
    }

    .plan-row { flex-direction: column; align-items: flex-start; }
    .confirm-dialog { padding: 1.5rem; }
    .edit-dialog { padding: 1.5rem; }
    .connector-dialog { padding: 1.5rem; }

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

    .ds-table { font-size: 0.8rem; }
    .ds-cell-actions .dataset-action-btn { opacity: 1; }

    .conn-actions { flex-wrap: wrap; }

}

/* ===================================================================
   Modules section
   =================================================================== */

/* --- Demo banner --- */
.mod-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1.15rem;
    background: rgba(255,123,0,0.06);
    border: 1px solid rgba(255,123,0,0.14);
    border-radius: 8px;
}

.mod-banner-body {
    font-size: 0.8rem;
    color: #a08050;
    line-height: 1.45;
}

.mod-banner-body strong { color: #d89540; }

.mod-banner-cta {
    flex-shrink: 0;
    padding: 0.4rem 1rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: #fff;
    background: #ff7b00;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.mod-banner-cta:hover { background: #e06e00; }

/* --- Toolbar --- */
.mod-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.mod-search-wrap {
    flex: 1;
    min-width: 180px;
    max-width: 340px;
    position: relative;
}

.mod-search-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    pointer-events: none;
}

.mod-search-input {
    width: 100%;
    padding: 0.5rem 0.7rem 0.5rem 2.1rem;
    font-size: 0.8rem;
    color: #e0e0e0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px;
    outline: none;
    font-family: 'Geist', sans-serif;
    transition: border-color 0.2s ease;
}

.mod-search-input::placeholder { color: #444; }
.mod-search-input:focus { border-color: rgba(255,123,0,0.3); }

.mod-status-row {
    display: flex;
    gap: 0.25rem;
}

.mod-pill {
    padding: 0.22rem 0.55rem;
    border-radius: 5px;
    font-size: 0.66rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.06);
    background: transparent;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Geist', sans-serif;
}

.mod-pill:hover { color: #999; border-color: rgba(255,255,255,0.12); }

.mod-pill.active {
    background: rgba(255,255,255,0.07);
    color: #d0d0d0;
    border-color: rgba(255,255,255,0.14);
}

.mod-counts {
    font-size: 0.72rem;
    color: #555;
    margin-left: auto;
    white-space: nowrap;
}

/* --- Tag bar --- */
.mod-tag-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    min-height: 28px;
}

.mod-active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.mod-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.66rem;
    font-weight: 500;
    color: #ff7b00;
    background: rgba(255,123,0,0.1);
    border: 1px solid rgba(255,123,0,0.2);
    border-radius: 5px;
}

.mod-tag-remove {
    background: none;
    border: none;
    color: #ff7b00;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    padding: 0;
    opacity: 0.6;
}

.mod-tag-remove:hover { opacity: 1; }

.mod-tag-add-wrap {
    position: relative;
}

.mod-tag-add-btn {
    padding: 0.2rem 0.55rem;
    font-size: 0.66rem;
    font-weight: 500;
    color: #555;
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Geist', sans-serif;
}

.mod-tag-add-btn:hover { color: #aaa; border-color: rgba(255,255,255,0.2); }

.mod-tag-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    width: 220px;
    max-height: 280px;
    background: #141418;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 20;
    overflow: hidden;
    flex-direction: column;
}

.mod-tag-dropdown.open { display: flex; }

.mod-tag-search {
    padding: 0.5rem 0.65rem;
    font-size: 0.75rem;
    color: #e0e0e0;
    background: rgba(255,255,255,0.04);
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    outline: none;
    font-family: 'Geist', sans-serif;
}

.mod-tag-search::placeholder { color: #444; }

.mod-tag-options {
    overflow-y: auto;
    max-height: 230px;
}

.mod-tag-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.4rem 0.65rem;
    font-size: 0.72rem;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: 'Geist', sans-serif;
    transition: background 0.1s ease;
}

.mod-tag-option:hover { background: rgba(255,255,255,0.04); color: #ccc; }

.mod-tag-option.active { color: #ff7b00; background: rgba(255,123,0,0.06); }

.mod-tag-count {
    font-size: 0.6rem;
    color: #444;
    font-family: 'Geist Mono', monospace;
}

/* --- Main layout: AZ | List | Detail --- */
.mod-layout {
    display: flex;
    gap: 0;
    align-items: stretch;
    min-height: 500px;
}

/* A-Z sidebar */
.mod-az {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding-right: 0.5rem;
    flex-shrink: 0;
}

.mod-az-btn {
    width: 22px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.56rem;
    font-weight: 600;
    font-family: 'Geist Mono', monospace;
    color: #3a3a44;
    background: none;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.1s ease;
    padding: 0;
}

.mod-az-btn:hover { color: #888; background: rgba(255,255,255,0.04); }

.mod-az-btn.active {
    color: #ff7b00;
    background: rgba(255,123,0,0.1);
}

/* Module list column */
.mod-list-col {
    width: 340px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    background: rgba(255,255,255,0.015);
}

.mod-list {
    display: flex;
    flex-direction: column;
}

.mod-loading {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.mod-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #555;
    font-size: 0.82rem;
}

/* Module list item */
.mod-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    cursor: pointer;
    transition: background 0.1s ease;
    border-left: 2px solid transparent;
    gap: 0.5rem;
}

.mod-item:last-child { border-bottom: none; }
.mod-item:hover { background: rgba(255,255,255,0.025); }

.mod-item.selected {
    background: rgba(255,123,0,0.06);
    border-left-color: #ff7b00;
}

.mod-item.enabled .mod-item-name { color: #e8e8e8; }

.mod-item-main {
    flex: 1;
    min-width: 0;
}

.mod-item-name {
    font-size: 0.8rem;
    font-weight: 550;
    color: #888;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mod-star {
    color: #ff7b00;
    font-size: 0.6rem;
    margin-left: 0.2rem;
}

.mod-item-sub {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.15rem;
}

.mod-item-cat {
    font-size: 0.58rem;
    color: #4a4a54;
}

.mod-item-tier {
    font-size: 0.52rem;
    font-weight: 600;
    font-family: 'Geist Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.08rem 0.3rem;
    border-radius: 3px;
}

.mod-item-tier.tier-demo {
    color: #5090d0;
    background: rgba(59,130,246,0.08);
}

.mod-item-tier.tier-std {
    color: #c08030;
    background: rgba(255,123,0,0.06);
}

/* --- Toggle --- */
.mod-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.mod-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mod-toggle-track {
    position: relative;
    width: 32px;
    height: 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    transition: all 0.2s ease;
}

.mod-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: #444;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.mod-toggle-input:checked + .mod-toggle-track {
    background: rgba(255,123,0,0.18);
    border-color: rgba(255,123,0,0.3);
}

.mod-toggle-input:checked + .mod-toggle-track .mod-toggle-thumb {
    left: 16px;
    background: #ff7b00;
    box-shadow: 0 0 5px rgba(255,123,0,0.3);
}

/* Module list column — constrain width so detail pane gets more space */
.mod-list-col {
    width: 280px;
    min-width: 240px;
    max-width: 320px;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: 75vh;
}

/* --- Detail column --- */
.mod-detail-col {
    flex: 1;
    min-width: 0;
    margin-left: 1rem;
    overflow-y: auto;
    max-height: 75vh;
}

/* Intro state (no module selected) */
.mod-detail-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 400px;
    padding: 2.5rem 2rem;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    background: rgba(255,255,255,0.015);
}

.mod-intro-icon { opacity: 0.12; margin-bottom: 1rem; }
.mod-intro-icon svg { stroke: #888; }

.mod-intro-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #c0c0c0;
    margin: 0 0 0.5rem;
}

.mod-intro-text {
    font-size: 0.8rem;
    color: #555;
    line-height: 1.55;
    max-width: 360px;
    margin: 0 0 1.5rem;
}

.mod-intro-stats {
    display: flex;
    gap: 2rem;
}

.mod-intro-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.68rem;
    color: #4a4a54;
}

.mod-intro-num {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ff7b00;
    font-family: 'Geist Mono', monospace;
}

/* Detail content (module selected) */
.mod-detail-content {
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    background: rgba(255,255,255,0.015);
}

.mod-d-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mod-d-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f0f0f0;
    margin: 0 0 0.6rem;
}

.mod-d-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.mod-d-badge {
    font-size: 0.6rem;
    font-weight: 500;
    color: #636b74;
    background: rgba(255,255,255,0.04);
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}

.mod-d-badge.tier-demo {
    color: #60a5fa;
    background: rgba(59,130,246,0.08);
    border-color: rgba(59,130,246,0.12);
}

.mod-d-badge.tier-std {
    color: #e09040;
    background: rgba(255,123,0,0.07);
    border-color: rgba(255,123,0,0.12);
}

.mod-d-badge-data {
    color: #8b7fc7;
    background: rgba(139,127,199,0.08);
    border-color: rgba(139,127,199,0.1);
}

.mod-d-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.mod-d-status {
    font-size: 0.72rem;
    font-weight: 600;
}

.mod-d-status.on { color: #ff7b00; }
.mod-d-status.off { color: #555; }

/* Detail sections */
.mod-d-section {
    margin-bottom: 1.1rem;
}

.mod-d-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.mod-d-desc {
    font-size: 0.82rem;
    color: #9aa0ac;
    line-height: 1.6;
    margin: 0;
}

.mod-d-text {
    font-size: 0.78rem;
    color: #777;
    line-height: 1.55;
    margin: 0;
}

/* Use cases */
.mod-d-use-cases {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mod-d-uc {
    padding: 0.6rem 0.8rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 6px;
}

.mod-d-uc-title {
    font-size: 0.78rem;
    font-weight: 550;
    color: #c0c8d0;
    margin-bottom: 0.2rem;
}

.mod-d-uc-desc {
    font-size: 0.72rem;
    color: #666;
    line-height: 1.45;
}

.mod-d-uc-bv {
    font-size: 0.68rem;
    color: #8b7fc7;
    margin-top: 0.25rem;
    font-style: italic;
}

/* When to use grid */
.mod-d-when-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.mod-d-when {
    padding: 0.7rem 0.85rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.04);
}

.mod-d-when-yes { background: rgba(34,197,94,0.04); border-color: rgba(34,197,94,0.1); }
.mod-d-when-no { background: rgba(239,68,68,0.04); border-color: rgba(239,68,68,0.1); }

.mod-d-when-yes .mod-d-label { color: #4ade80; }
.mod-d-when-no .mod-d-label { color: #f87171; }

/* Assumptions/Limitations grid */
.mod-d-al-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.mod-d-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.72rem;
    color: #666;
    line-height: 1.6;
}

.mod-d-list li { margin-bottom: 0.2rem; }

/* Metadata row */
.mod-d-meta-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mod-d-meta-cell {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    padding: 0.4rem 0.6rem;
    background: rgba(255,255,255,0.025);
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.04);
    flex: 1;
    min-width: 100px;
}

.mod-d-meta-k {
    font-size: 0.56rem;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.mod-d-meta-v {
    font-size: 0.76rem;
    color: #b8bfc8;
    font-weight: 500;
}

/* Keywords */
.mod-d-kws {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.mod-d-kw {
    font-size: 0.58rem;
    color: #8b7fc7;
    background: rgba(139,127,199,0.08);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    border: 1px solid rgba(139,127,199,0.1);
    font-family: 'Geist Mono', monospace;
}

/* Tool ID code */
.mod-d-code {
    display: block;
    font-family: 'Geist Mono', monospace;
    font-size: 0.7rem;
    color: #636b74;
    background: rgba(255,255,255,0.03);
    padding: 0.45rem 0.65rem;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.04);
    word-break: break-all;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .mod-layout { flex-direction: column; }
    .mod-az { flex-direction: row; flex-wrap: wrap; padding-right: 0; padding-bottom: 0.5rem; }
    .mod-az-btn { width: 24px; height: 24px; }
    .mod-list-col { width: 100%; max-height: 45vh; }
    .mod-detail-col { margin-left: 0; margin-top: 0.75rem; }
    .mod-d-when-grid { grid-template-columns: 1fr; }
    .mod-d-al-grid { grid-template-columns: 1fr; }
    .mod-toolbar { flex-direction: column; align-items: stretch; }
    .mod-search-wrap { max-width: none; }
    .mod-counts { margin-left: 0; }
}

/* Module tabs */
.mod-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mod-tab {
    padding: 0.6rem 1.2rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.mod-tab:hover { color: #cbd5e1; }
.mod-tab.active {
    color: #e2e8f0;
    border-bottom-color: #FF7B00;
}
.mod-tab-badge {
    font-size: 0.6rem;
    background: #FF7B00;
    color: #fff;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}


/* ============================================
   Mining Tab
   ============================================ */

.mining-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Top bar */
.mining-topbar {
    margin-bottom: 0.75rem;
}

/* Split pane */
.mining-main {
    display: flex;
    border: 1px solid #1a1a22;
    border-radius: 12px;
    background: #0d0d14;
    overflow: hidden;
    min-height: 500px;
}

/* Left column: card list */
.mining-list-col {
    flex: 0 0 33%;
    max-width: 33%;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    background: rgba(0,0,0,0.15);
    border-right: 1px solid #1a1a22;
}

/* Right column: plot + detail */
.mining-detail-col {
    flex: 1 1 auto;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    display: flex;
    flex-direction: column;
}

/* Search */
.mining-search-bar {
    padding: 0 0 0.5rem;
}
.mining-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.mining-search-icon {
    position: absolute;
    left: 12px;
    color: #555;
    pointer-events: none;
}
.mining-search-input {
    width: 100%;
    background: #111118;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.mining-search-input:focus {
    border-color: #ff7b00;
}
.mining-search-input::placeholder {
    color: #444;
}
.mining-search-status {
    position: absolute;
    right: 12px;
    font-size: 0.75rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Toolbar (filters + view toggle) */
.mining-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0 0.75rem;
}

/* Controls row */
.mining-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.mining-topn-label {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.mining-topn-input {
    width: 50px;
    background: #111118;
    border: 1px solid #222;
    border-radius: 6px;
    color: #e0e0e0;
    font-family: 'Geist Mono', monospace;
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
    text-align: center;
    outline: none;
}
.mining-topn-input:focus { border-color: #ff7b00; }

/* View toggle */
.mining-view-toggle {
    display: flex;
    border: 1px solid #222;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.mining-view-btn {
    background: #111118;
    border: none;
    color: #666;
    font-family: 'Geist Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
}
.mining-view-btn:first-child { border-right: 1px solid #222; }
.mining-view-btn:hover { color: #bbb; }
.mining-view-btn.active {
    background: rgba(255, 123, 0, 0.15);
    color: #ff7b00;
}

/* Filters */
.mining-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.mining-filter-chip {
    padding: 0.25rem 0.7rem;
    font-size: 0.75rem;
    border-radius: 20px;
    border: 1px solid #222;
    background: #111118;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.mining-filter-chip:hover {
    border-color: #444;
    color: #bbb;
}
.mining-filter-chip.active {
    background: rgba(255, 123, 0, 0.15);
    border-color: #ff7b00;
    color: #ff7b00;
}

/* Plot */
.mining-plot-wrap {
    border-bottom: 1px solid #1a1a22;
}
.mining-plot {
    width: 100%;
    min-height: 400px;
}
.mining-plot .plot-container {
    width: 100% !important;
}
.mining-plot .svg-container {
    width: 100% !important;
}
.mining-plot-loading,
.mining-plot-empty {
    text-align: center;
    padding: 3rem;
    color: #555;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}
.mining-plot-empty p {
    font-size: 0.85rem;
}

/* Left column empty state */
.mining-list-empty {
    padding: 2rem 1.25rem;
    text-align: center;
}
.mining-list-empty-icon {
    margin-bottom: 0.75rem;
    opacity: 0.6;
}
.mining-list-empty-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #aaa;
    margin-bottom: 0.4rem;
}
.mining-list-empty-desc {
    font-size: 0.75rem;
    color: #555;
    line-height: 1.5;
}
.mining-cards-placeholder {
    padding: 2rem 1rem;
    text-align: center;
    color: #444;
    font-size: 0.8rem;
}

/* Welcome / onboarding (right column) */
.mining-welcome {
    max-width: 520px;
}
.mining-welcome-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.mining-welcome-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
}
.mining-welcome-desc {
    font-size: 0.82rem;
    color: #888;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}
.mining-welcome-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.mining-welcome-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid #1a1a22;
    border-radius: 8px;
}
.mining-step-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,123,0,0.15);
    color: #ff7b00;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}
.mining-welcome-step strong {
    display: block;
    font-size: 0.8rem;
    color: #ccc;
    margin-bottom: 2px;
}
.mining-welcome-step span {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.4;
}
.mining-cards-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #1a1a22;
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(10,10,15,0.95);
}
.mining-cards-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ccc;
}
.mining-cards-count {
    font-size: 0.7rem;
    color: #555;
}
.mining-cards-list {
    overflow-y: auto;
}

/* Card row */
.mining-card-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #111;
    cursor: pointer;
    transition: background 0.1s;
}
.mining-card-row:hover {
    background: rgba(255, 255, 255, 0.02);
}
.mining-card-row.selected {
    background: rgba(255, 123, 0, 0.06);
    border-left: 2px solid #ff7b00;
}
.mining-card-row-main {
    flex: 1;
    min-width: 0;
}
.mining-card-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mining-card-key {
    font-size: 0.7rem;
    color: #555;
    font-family: 'Geist Mono', monospace;
    margin-top: 2px;
}
.mining-card-row-meta {
    flex-shrink: 0;
    text-align: right;
}
.mining-card-sim {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ff7b00;
    font-family: 'Geist Mono', monospace;
}
.mining-card-preview {
    font-size: 0.7rem;
    color: #444;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Card detail panel (below plot in right column) */
.mining-card-detail {
    padding: 1.25rem;
    flex: 1;
}
.mining-detail-loading {
    color: #666;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 1rem 0;
}
.mining-detail-empty {
    color: #555;
    font-size: 0.85rem;
    padding: 1rem 0;
    text-align: center;
}
.mining-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.mining-detail-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0e0e0;
}
.mining-detail-type {
    font-size: 0.7rem;
    color: #666;
    background: #1a1a22;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Geist Mono', monospace;
}

/* Metrics */
.mining-detail-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.mining-metric {
    background: #111118;
    border: 1px solid #1a1a22;
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    min-width: 100px;
}
.mining-metric-label {
    display: block;
    font-size: 0.65rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.mining-metric-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0e0e0;
    font-family: 'Geist Mono', monospace;
    margin-top: 2px;
}

/* Detail plot */
.mining-detail-plot {
    margin: 0.75rem 0;
    border-radius: 8px;
    overflow: hidden;
}

/* Detail table */
.mining-detail-table-wrap {
    overflow-x: auto;
    margin: 0.75rem 0;
    border-radius: 8px;
    border: 1px solid #1a1a22;
}
.mining-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.mining-detail-table th {
    background: #111118;
    color: #888;
    font-weight: 500;
    text-align: left;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #1a1a22;
    white-space: nowrap;
}
.mining-detail-table td {
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid #0f0f14;
    color: #bbb;
    font-family: 'Geist Mono', monospace;
}
.mining-detail-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Insight */
.mining-detail-insight {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #111118;
    border-radius: 8px;
    border: 1px solid #1a1a22;
}
.mining-insight-label {
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.4rem;
}
.mining-insight-text {
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.5;
}
.mining-insight-text p {
    margin-bottom: 0.4rem;
}
.mining-insight-text p:last-child {
    margin-bottom: 0;
}

/* Spinner small (reuse) */
.spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 123, 0, 0.2);
    border-top-color: #ff7b00;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

/* Mobile */
@media (max-width: 900px) {
    .mining-main { flex-direction: column; }
    .mining-list-col {
        flex: none;
        max-width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #1a1a22;
    }
    .mining-detail-col { flex: none; max-height: none; }
    .mining-plot { min-height: 280px; }
    .mining-card-preview { display: none; }
}

/* ========================================================================
   Preferences Section
   ======================================================================== */
.pref-group {
    margin-bottom: 1.25rem;
}
.pref-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 0.4rem;
}
.pref-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}
.pref-select {
    width: 100%;
    max-width: 360px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    background: #0d0d12;
    color: #e2e8f0;
    border: 1px solid #2a2a35;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s;
}
.pref-select:focus {
    border-color: #ff7b00;
}
.pref-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 360px;
}
.pref-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.pref-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.pref-toggle-slider {
    position: absolute;
    inset: 0;
    background: #2a2a35;
    border-radius: 22px;
    cursor: pointer;
    transition: background 0.2s;
}
.pref-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #e2e8f0;
    border-radius: 50%;
    transition: transform 0.2s;
}
.pref-toggle input:checked + .pref-toggle-slider {
    background: #ff7b00;
}
.pref-toggle input:checked + .pref-toggle-slider::before {
    transform: translateX(18px);
}

/* ============================================
   API Key Section
   ============================================ */

.apikey-display {
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.apikey-value {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.95rem;
    color: #e0e0e0;
    letter-spacing: 0.02em;
    word-break: break-all;
}

.apikey-value.apikey-new {
    color: #4ade80;
    animation: apikey-flash 0.5s ease-out;
}

@keyframes apikey-flash {
    0% { background: rgba(74, 222, 128, 0.2); }
    100% { background: transparent; }
}

.btn-danger-outline {
    background: transparent;
    color: #f87171;
    border: 1px solid #f87171;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}
.btn-danger-outline:hover {
    background: #f87171;
    color: #fff;
}

.apikey-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #2a2a3e;
}
.apikey-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    color: #b0b0b0;
}
.apikey-meta-label {
    color: #888;
}

.apikey-usage-bar {
    height: 4px;
    background: #2a2a3e;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}
.apikey-usage-fill {
    height: 100%;
    background: #ff7b00;
    border-radius: 2px;
    transition: width 0.3s ease;
}
.apikey-usage-fill.warning { background: #facc15; }
.apikey-usage-fill.danger { background: #f87171; }

/* Config snippet tabs */
.apikey-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 1px solid #2a2a3e;
}
.apikey-tab {
    background: transparent;
    border: none;
    color: #888;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.apikey-tab:hover { color: #ccc; }
.apikey-tab.active {
    color: #ff7b00;
    border-bottom-color: #ff7b00;
}

.apikey-snippet-wrap {
    position: relative;
}
.apikey-snippet {
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 1rem 1.25rem;
    padding-right: 5rem;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.8rem;
    color: #c0c0c0;
    overflow-x: auto;
    white-space: pre;
    margin: 0;
    line-height: 1.5;
}
.apikey-snippet-copy {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
}
