/* =============================================================================
   CaleraLabs — Dashboard Styles (Sprint 3)
   =============================================================================
   Glassmorphic authenticated dashboard. Uses shared CSS custom properties
   from style.css (loaded via :root — no @import needed).
   
   Components:
     - Dashboard grid layout
     - Profile card & license key display
     - Usage telemetry chart
     - API sandbox (relocated from index.html)
     - API reference endpoint cards (tier-gated)
     - PQC security panel
     - Auth overlays (loading, error, login)
     - Dashboard header bar
   ============================================================================= */

/* ─── Dashboard Layout ─────────────────────────────────────────────────── */

.dash-body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    background: var(--nav-bg);
    height: 64px;
}

.dash-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dash-header-left .logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

.dash-header-left .logo span {
    color: var(--accent-solid);
}

.dash-header-left .logo-mark {
    width: 24px;
    height: 24px;
}

.dash-header-left .dash-divider {
    width: 1px;
    height: 24px;
    background: var(--glass-border);
    margin: 0 0.25rem;
}

.dash-header-left .dash-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.dash-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dash-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dash-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    object-fit: cover;
}

.dash-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.dash-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dash-user-email {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.dash-sign-out {
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.dash-sign-out:hover {
    border-color: var(--accent-solid);
    color: var(--accent-solid);
    background: rgba(0, 255, 200, 0.05);
}

/* ─── PQC Status Badge (Header) ────────────────────────────────────────── */

.pqc-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid;
    transition: all 0.3s ease;
}

.pqc-status-badge.verified {
    border-color: rgba(0, 255, 200, 0.3);
    background: rgba(0, 255, 200, 0.08);
    color: var(--accent-solid);
}

.pqc-status-badge.not-enrolled {
    border-color: rgba(255, 82, 82, 0.3);
    background: rgba(255, 82, 82, 0.08);
    color: #ff5252;
}

.pqc-status-badge.verifying {
    border-color: rgba(255, 193, 7, 0.3);
    background: rgba(255, 193, 7, 0.08);
    color: #ffc107;
}

.pqc-status-badge.expired {
    border-color: rgba(255, 152, 0, 0.3);
    background: rgba(255, 152, 0, 0.08);
    color: #ff9800;
}

.pqc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.pqc-dot.verified {
    background: var(--accent-solid);
    box-shadow: 0 0 8px var(--accent-solid);
}

.pqc-dot.verifying {
    background: #ffc107;
    animation: pqcPulse 1.2s ease-in-out infinite;
}

.pqc-dot.error,
.pqc-dot.inactive {
    background: #ff5252;
}

@keyframes pqcPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* ─── Dashboard Layout Shell ───────────────────────────────────────────── */

#dashboard-content {
    display: none;
    padding-top: 64px; /* clear fixed header */
}

#dashboard-content.authenticated {
    display: block;
}

.dash-layout {
    display: flex;
    min-height: calc(100vh - 64px);
    align-items: flex-start;
}

/* ─── Sidebar Navigation ───────────────────────────────────────────────── */

.dash-sidebar {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    scrollbar-width: none;
    transition: transform 0.3s ease;
    z-index: 50;
}

.dash-sidebar::-webkit-scrollbar { display: none; }

.dash-sidebar-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 1.25rem 0.75rem;
}

.dash-sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
    text-align: left;
    white-space: nowrap;
}

.dash-nav-item:hover {
    color: var(--text-primary);
    background: var(--surface-inset);
}

[data-theme='dark'] .dash-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dash-nav-item.active {
    color: var(--accent-solid);
    background: rgba(0, 255, 200, 0.08);
    font-weight: 600;
}

[data-theme='dark'] .dash-nav-item.active {
    background: rgba(0, 255, 200, 0.06);
}

.dash-nav-item svg {
    flex-shrink: 0;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.dash-nav-item:hover svg,
.dash-nav-item.active svg { opacity: 1; }

.nav-label {
    letter-spacing: 0.01em;
}

/* ─── Sidebar Toggle Button ────────────────────────────────────────────── */

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    margin-right: 0.25rem;
    transition: background 0.2s ease;
}

.sidebar-toggle:hover { background: var(--surface-inset); }

[data-theme='dark'] .sidebar-toggle:hover { background: rgba(255, 255, 255, 0.06); }

.sidebar-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.2s ease;
}

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

/* ─── Dashboard Main Content ───────────────────────────────────────────── */

.dash-main {
    flex: 1;
    min-width: 0;
    padding: 1.75rem 2rem 3rem;
    overflow-x: hidden;
    overflow-y: auto;
    height: calc(100vh - 64px);
}

/* ─── Glass Card (Shared) ──────────────────────────────────────────────── */

.dash-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dash-card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-solid);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-card-title .title-icon {
    font-size: 1rem;
}

/* ─── Profile Card ─────────────────────────────────────────────────────── */

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--accent-solid);
    object-fit: cover;
    box-shadow: 0 0 16px rgba(0, 255, 200, 0.2);
}

.profile-meta {
    flex: 1;
}

.profile-org {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.profile-email {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Tier Badge */
.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.tier-badge.pilot { background: rgba(66, 165, 245, 0.15); color: #42a5f5; border: 1px solid rgba(66, 165, 245, 0.3); }
.tier-badge.hacker { background: rgba(0, 255, 200, 0.1); color: var(--accent-solid); border: 1px solid rgba(0, 255, 200, 0.25); }
.tier-badge.startup { background: rgba(126, 63, 255, 0.12); color: #b592ff; border: 1px solid rgba(126, 63, 255, 0.3); }
.tier-badge.starter { background: rgba(255, 193, 7, 0.12); color: #ffc107; border: 1px solid rgba(255, 193, 7, 0.3); }
.tier-badge.professional { background: rgba(244, 67, 54, 0.12); color: #ef5350; border: 1px solid rgba(244, 67, 54, 0.3); }
.tier-badge.enterprise { background: rgba(255, 215, 0, 0.12); color: #ffd700; border: 1px solid rgba(255, 215, 0, 0.3); }

/* License Key Display */
.license-key-block {
    margin-top: 1rem;
}

.license-key-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.license-key-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-deep);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
}

.license-key-value {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    flex: 1;
    letter-spacing: 1px;
    user-select: all;
}

.license-key-btn {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.license-key-btn:hover {
    border-color: var(--accent-solid);
    color: var(--accent-solid);
}

.license-key-btn.copied {
    border-color: var(--accent-solid);
    color: var(--accent-solid);
    background: rgba(0, 255, 200, 0.08);
}

/* License Expiry */
.license-expiry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.65rem 0.85rem;
    background: var(--surface-inset);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.expiry-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    flex: 1;
}

.expiry-text strong {
    color: var(--text-primary);
}

.expiry-bar {
    flex: 1;
    height: 4px;
    background: var(--glass-border);
    border-radius: 4px;
    overflow: hidden;
}

.expiry-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-solid), var(--accent-secondary));
    transition: width 0.5s ease;
}

/* ─── Feature Gates Panel ──────────────────────────────────────────────── */

.feature-gates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
}

.feature-gate-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: var(--surface-inset);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.feature-gate-item.unlocked {
    color: var(--text-primary);
}

.gate-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.gate-icon.locked {
    opacity: 0.5;
}

.feature-gate-item .gate-unlock-hint {
    font-size: 0.65rem;
    color: var(--accent-secondary);
    margin-left: auto;
}

/* ─── Usage Telemetry ──────────────────────────────────────────────────── */

.usage-summary {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.usage-stat {
    flex: 1;
    text-align: center;
    padding: 0.85rem;
    background: var(--surface-inset);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.usage-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.usage-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.quota-indicator {
    margin-bottom: 1.25rem;
}

.quota-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.quota-bar {
    height: 6px;
    background: var(--glass-border);
    border-radius: 6px;
    overflow: hidden;
}

.quota-bar-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--accent-solid), #00e5b0);
    transition: width 0.6s ease;
}

.quota-bar-fill.warning {
    background: linear-gradient(90deg, #ffc107, #ff9800);
}

.quota-bar-fill.critical {
    background: linear-gradient(90deg, #ff5252, #ff1744);
}

.usage-chart-container {
    position: relative;
    height: 220px;
    margin-top: 0.5rem;
}

/* ─── API Sandbox (Dashboard) ──────────────────────────────────────────── */

.dash-sandbox-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dash-sandbox-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dash-sandbox-field label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.dash-sandbox-field input,
.dash-sandbox-field select {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.dash-sandbox-field input:focus,
.dash-sandbox-field select:focus {
    border-color: var(--accent-solid);
    box-shadow: 0 0 0 2px rgba(0, 255, 200, 0.1);
}

.dash-sandbox-field input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.dash-sandbox-field input[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
}

.dash-sandbox-preview {
    background: var(--surface-deep);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 0.75rem;
}

.dash-sandbox-preview code {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.8rem;
    color: var(--accent-solid);
    white-space: pre;
    line-height: 1.6;
}

.dash-sandbox-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.dash-sandbox-response {
    background: var(--surface-inset);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.75rem;
}

.dash-sandbox-response h5 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-sandbox-response pre {
    background: var(--surface-deep);
    border-radius: 6px;
    padding: 0.85rem;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

.dash-sandbox-response code {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.78rem;
    color: var(--text-primary);
    white-space: pre;
}

.status-badge-inline {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
}

.status-badge-inline.status-online {
    background: rgba(0, 255, 200, 0.12);
    color: var(--accent-solid);
}

.status-badge-inline.status-offline {
    background: rgba(255, 82, 82, 0.12);
    color: #ff5252;
}

/* ─── API Reference (Dashboard) ────────────────────────────────────────── */

.dash-endpoint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.dash-endpoint-card {
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.dash-endpoint-card:hover {
    border-color: rgba(0, 255, 200, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.dash-endpoint-card .endpoint-method {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: 'Space Grotesk', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.dash-endpoint-card .endpoint-method.get {
    background: rgba(66, 165, 245, 0.15);
    color: #42a5f5;
}

.dash-endpoint-card .endpoint-method.post {
    background: rgba(0, 255, 200, 0.12);
    color: var(--accent-solid);
}

.dash-endpoint-card code {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.82rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.35rem;
}

.dash-endpoint-card p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Tier-locked overlay */
.dash-endpoint-card.locked {
    opacity: 0.5;
    pointer-events: none;
}

.dash-endpoint-card.locked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    border-radius: 10px;
    z-index: 1;
}

.endpoint-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    gap: 0.35rem;
}

.endpoint-lock-overlay .lock-icon {
    font-size: 1.2rem;
}

.endpoint-lock-overlay .lock-text {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── PQC Security Panel ──────────────────────────────────────────────── */

.pqc-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.pqc-detail-item {
    padding: 0.75rem;
    background: var(--surface-inset);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.pqc-detail-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.pqc-detail-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pqc-detail-value.mono {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
}

.session-countdown-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: rgba(0, 255, 200, 0.05);
    border: 1px solid rgba(0, 255, 200, 0.15);
    border-radius: 8px;
}

.session-countdown-display .countdown-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.session-countdown-display .countdown-value {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-solid);
}

/* ─── Auth Overlays ────────────────────────────────────────────────────── */

.auth-loading-overlay,
.auth-error-overlay,
.auth-login-overlay,
.auth-fallback-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: 2rem;
}

.auth-loading-content,
.auth-error-content,
.auth-login-content,
.auth-fallback-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--card-shadow);
}

.auth-loading-content h2,
.auth-error-content h2,
.auth-login-content h2,
.auth-fallback-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-transform: none;
    letter-spacing: -0.5px;
}

.auth-loading-content p,
.auth-error-content p,
.auth-login-content p,
.auth-fallback-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.auth-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 1.5rem;
}

.pqc-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-solid);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.pqc-status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pqc-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.auth-status-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.auth-error-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.auth-error-actions,
.auth-fallback-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

.auth-pqc-notice {
    font-size: 0.78rem !important;
    color: var(--text-secondary) !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.auth-pqc-notice .pqc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: rgba(0, 255, 200, 0.08);
    border: 1px solid rgba(0, 255, 200, 0.2);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-solid);
}

/* Google Sign-In Button */
.google-sign-in {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
}

/* ─── Buttons (Dashboard variants) ─────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn.primary {
    background: var(--accent-solid);
    color: #050508;
}

.btn.primary:hover {
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn.secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn.secondary:hover {
    border-color: var(--accent-solid);
    color: var(--accent-solid);
}

.btn.small {
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
}

/* ─── Toast Notification ───────────────────────────────────────────────── */

.dash-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.75rem 1.25rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    font-size: 0.82rem;
    color: var(--text-primary);
    z-index: 1000;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.dash-toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.dash-toast.success {
    border-color: rgba(0, 255, 200, 0.3);
}

/* ─── Section Headers ───────────────────────────────────────────────────── */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-grid.full-width {
    grid-template-columns: 1fr;
}

.dash-section {
    display: none;
}

.dash-section.active {
    display: block;
    animation: sectionFadeIn 0.18s ease;
}

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

.section-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    letter-spacing: -0.3px;
}

.section-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ─── Engine Health Card ────────────────────────────────────────────────── */

.health-refresh-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.2rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.health-refresh-btn:hover { color: var(--accent-solid); }

.health-refresh-btn.spinning svg {
    animation: spin 0.6s linear;
}

.health-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface-inset);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.health-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.health-dot.online {
    background: var(--accent-solid);
    box-shadow: 0 0 8px var(--accent-solid);
}

.health-dot.offline {
    background: #ff5252;
    box-shadow: 0 0 6px rgba(255, 82, 82, 0.5);
}

.health-dot.verifying {
    background: #ffc107;
    animation: pqcPulse 1.2s ease-in-out infinite;
}

.health-status-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.health-latency-badge {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 50px;
    background: var(--surface-inset);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.health-latency-badge.fast {
    background: rgba(0, 255, 200, 0.1);
    border-color: rgba(0, 255, 200, 0.25);
    color: var(--accent-solid);
}

.health-latency-badge.slow {
    background: rgba(255, 82, 82, 0.1);
    border-color: rgba(255, 82, 82, 0.25);
    color: #ff5252;
}

.health-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.health-metric {
    padding: 0.65rem 0.75rem;
    background: var(--surface-inset);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    text-align: center;
}

.health-metric-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.health-metric-label {
    font-size: 0.67rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.health-last-checked {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 0.25rem;
}

/* ─── Recent Query Log ──────────────────────────────────────────────────── */

.query-log-clear-btn {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.query-log-clear-btn:hover {
    border-color: #ff5252;
    color: #ff5252;
}

.query-log-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

.query-log-list::-webkit-scrollbar { width: 4px; }
.query-log-list::-webkit-scrollbar-track { background: transparent; }
.query-log-list::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }

.query-log-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.query-log-empty p {
    font-size: 0.85rem;
    margin: 0;
}

.query-log-empty-hint {
    font-size: 0.75rem !important;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 0.3rem !important;
}

.query-log-item {
    padding: 0.6rem 0.75rem;
    background: var(--surface-inset);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: border-color 0.2s ease;
}

.query-log-item:hover {
    border-color: rgba(0, 255, 200, 0.2);
}

.query-log-query {
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.query-log-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.query-log-badge {
    font-size: 0.67rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 50px;
}

.query-log-badge.answer {
    background: rgba(0, 255, 200, 0.1);
    color: var(--accent-solid);
    border: 1px solid rgba(0, 255, 200, 0.2);
}

.query-log-badge.refusal {
    background: rgba(255, 193, 7, 0.12);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.25);
}

.query-log-badge.error {
    background: rgba(255, 82, 82, 0.1);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.2);
}

.query-log-latency {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.query-log-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-left: auto;
    opacity: 0.7;
}

/* ─── PQC Enhancements ──────────────────────────────────────────────────── */

.pqc-fingerprint-block {
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: var(--surface-inset);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

.pqc-fingerprint-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.pqc-fingerprint-value {
    font-family: 'Space Grotesk', monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
    word-break: break-all;
    line-height: 1.4;
}

.pqc-events-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.pqc-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pqc-event-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
}

.pqc-event-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pqc-event-dot.success { background: var(--accent-solid); }
.pqc-event-dot.info    { background: #42a5f5; }
.pqc-event-dot.warning { background: #ffc107; }
.pqc-event-dot.error   { background: #ff5252; }

.pqc-event-text {
    flex: 1;
    color: var(--text-secondary);
}

.pqc-event-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.6;
    white-space: nowrap;
}

/* ─── Tier Comparison Table ─────────────────────────────────────────────── */

.tier-comparison-table {
    overflow-x: auto;
    margin-bottom: 1.75rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

.tier-table {
    display: table;
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.tier-row {
    display: table-row;
}

.tier-row-alt .tier-cell {
    background: var(--surface-inset);
}

[data-theme='dark'] .tier-row-alt .tier-cell {
    background: rgba(255, 255, 255, 0.025);
}

.tier-cell {
    display: table-cell;
    padding: 0.65rem 0.9rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.tier-row:last-child .tier-cell {
    border-bottom: none;
}

.tier-label-cell {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    width: 140px;
}

.tier-head-cell {
    text-align: center;
    padding: 1rem 0.9rem;
    background: var(--surface-inset);
    border-right: 1px solid var(--glass-border);
    position: relative;
}

[data-theme='dark'] .tier-head-cell {
    background: rgba(255, 255, 255, 0.03);
}

.tier-head-cell:last-child { border-right: none; }

.tier-head-cell.is-current {
    background: rgba(0, 255, 200, 0.06);
    border-right: 1px solid rgba(0, 255, 200, 0.15);
}

.tier-current-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-solid);
    background: rgba(0, 255, 200, 0.12);
    border: 1px solid rgba(0, 255, 200, 0.25);
    border-radius: 50px;
    padding: 0.15rem 0.5rem;
    margin-bottom: 0.4rem;
    display: inline-block;
}

.tier-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--tc, var(--text-primary));
    margin-bottom: 0.2rem;
}

.tier-price {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.tier-value-cell {
    text-align: center;
    border-right: 1px solid var(--glass-border);
}

.tier-value-cell:last-child { border-right: none; }

.tier-value-cell.is-current {
    background: rgba(0, 255, 200, 0.04);
    color: var(--text-primary);
    font-weight: 500;
}

/* ─── Upgrade CTA ───────────────────────────────────────────────────────── */

.upgrade-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem;
    background: rgba(0, 255, 200, 0.04);
    border: 1px solid rgba(0, 255, 200, 0.12);
    border-radius: 10px;
}

.upgrade-cta-text {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    min-width: 200px;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

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

    .dash-main {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

@media (max-width: 900px) {
    .dash-sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        height: calc(100vh - 64px);
        transform: translateX(-100%);
        z-index: 50;
        border-right: 1px solid var(--glass-border);
        background: var(--nav-bg);
    }

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

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

    .sidebar-toggle {
        display: flex;
    }

    .dash-main {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    .dash-header {
        padding: 0.75rem 1rem;
    }

    .dash-header-left .dash-title {
        display: none;
    }

    .dash-user-meta {
        display: none;
    }

    .pqc-details-grid {
        grid-template-columns: 1fr;
    }

    .feature-gates {
        grid-template-columns: 1fr;
    }

    .usage-summary {
        flex-direction: column;
    }

    .dash-sandbox-actions {
        flex-wrap: wrap;
    }

    .upgrade-cta {
        flex-direction: column;
        align-items: flex-start;
    }

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

@media (max-width: 480px) {
    .dash-header-left .dash-divider {
        display: none;
    }

    .dash-card {
        padding: 1.25rem;
    }

    .tier-table {
        min-width: 560px;
    }
}
