/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Refined color palette with deeper blues and warmer accents */
    --primary-blue: #1E40AF;
    --primary-light: #3B82F6;
    --primary-soft: #60A5FA;
    --primary-dark: #1E3A8A;
    --accent-teal: #0D9488;
    --accent-amber: #F59E0B;
    --bg-gradient-start: #EFF6FF;
    --bg-gradient-end: #F8FAFC;
    --bg-white: #FFFFFF;
    --bg-subtle: #F1F5F9;
    --bg-elevated: #FFFFFF;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --border-light: #E2E8F0;
    --border-medium: #CBD5E1;
    --shadow-soft: 0 4px 20px rgba(15, 23, 42, 0.06);
    --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 10px 40px rgba(15, 23, 42, 0.12);
    --shadow-elevated: 0 20px 50px rgba(15, 23, 42, 0.15);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Font families */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', monospace;
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --primary-blue: #3B82F6;
    --primary-light: #60A5FA;
    --primary-soft: #93C5FD;
    --primary-dark: #2563EB;
    --accent-teal: #14B8A6;
    --accent-amber: #FBBF24;
    --bg-gradient-start: #0F172A;
    --bg-gradient-end: #1E293B;
    --bg-white: #1E293B;
    --bg-subtle: #334155;
    --bg-elevated: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;
    --border-light: #334155;
    --border-medium: #475569;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-elevated: 0 20px 50px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] body {
    background: #0F172A;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.15) 0%, transparent 60%),
        linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
}

/* Dark mode specific overrides */
[data-theme="dark"] .header {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: #334155;
}

[data-theme="dark"] .welcome-banner {
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
}

[data-theme="dark"] .welcome-banner .btn {
    background: #F1F5F9;
    color: #1E3A8A;
}

[data-theme="dark"] .upload-zone {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-color: #3B82F6;
}

[data-theme="dark"] .upload-zone:hover {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.3) 0%, rgba(59, 130, 246, 0.15) 100%);
    border-color: #60A5FA;
}

[data-theme="dark"] .code-block {
    background: #0F172A;
    border-color: #334155;
}

[data-theme="dark"] .code-block pre {
    background: #0F172A;
}

[data-theme="dark"] .info-box {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.2) 0%, rgba(30, 41, 59, 0.5) 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .warning-box {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.2) 0%, rgba(30, 41, 59, 0.5) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .success-box {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.2) 0%, rgba(30, 41, 59, 0.5) 100%);
    border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .error-box {
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.2) 0%, rgba(30, 41, 59, 0.5) 100%);
    border-color: rgba(254, 202, 202, 0.3);
}

[data-theme="dark"] .warning-box h4 {
    color: #FCD34D;
}

[data-theme="dark"] .success-box h4 {
    color: #86EFAC;
}

[data-theme="dark"] .error-box h4 {
    color: #FCA5A5;
}

/* Dark mode styles for upload result info */
[data-theme="dark"] .result-info {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.15) 0%, var(--bg-elevated) 100%);
    border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .result-info code {
    background: var(--bg-subtle) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-medium);
}

/* Dark mode styles for auto-suggestion */
[data-theme="dark"] .auto-suggestion {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, var(--bg-elevated) 100%);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--primary-light);
}

/* Dark mode styles for range input tables */
[data-theme="dark"] .range-input-table {
    background: var(--bg-subtle);
    border-color: var(--border-medium);
}

[data-theme="dark"] .range-input-table .table-container {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .range-input-table .range-table thead th,
[data-theme="dark"] .range-input-table .range-table tbody th {
    background: var(--bg-subtle);
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

[data-theme="dark"] .range-input-table .range-table td {
    border-color: var(--border-light);
}

[data-theme="dark"] .range-input-table .table-cell-input {
    color: var(--text-primary);
}

[data-theme="dark"] .range-input-table .table-cell-input:hover {
    background: rgba(59, 130, 246, 0.08);
}

[data-theme="dark"] .range-input-table .table-cell-input:focus {
    background: rgba(59, 130, 246, 0.15);
    box-shadow: inset 0 0 0 2px var(--primary-soft);
}

[data-theme="dark"] .range-input-table .range-table tbody tr:nth-child(even) td {
    background: rgba(30, 41, 59, 0.3);
}

[data-theme="dark"] .range-input-table .range-table tbody tr:hover td {
    background: rgba(59, 130, 246, 0.08);
}

/* Dark mode styles for data type badges */
[data-theme="dark"] .data-type-badge {
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

[data-theme="dark"] .data-type-badge[data-type="number"] {
    background: rgba(34, 197, 94, 0.2);
    color: #86EFAC;
}

[data-theme="dark"] .data-type-badge[data-type="string"] {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-light);
}

[data-theme="dark"] .data-type-badge[data-type="boolean"] {
    background: rgba(245, 158, 11, 0.2);
    color: #FCD34D;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #1E293B;
    border-color: #475569;
    color: #F1F5F9;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--primary-soft);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Dark mode styles for select options */
[data-theme="dark"] select option {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #64748B;
}

[data-theme="dark"] .btn-secondary {
    background: #334155;
    color: #F1F5F9;
    border-color: #475569;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #475569;
    border-color: #64748B;
}

[data-theme="dark"] .tab-buttons {
    background: #0F172A;
}

[data-theme="dark"] .tab-button:hover {
    background: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .tab-button.active {
    background: #1E293B;
}

[data-theme="dark"] .status-indicator {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.2) 0%, rgba(30, 41, 59, 0.8) 100%);
    border-color: rgba(34, 197, 94, 0.4);
    color: #86EFAC;
}

[data-theme="dark"] .toast {
    background: #1E293B;
    border-color: #475569;
}

[data-theme="dark"] .modal-content {
    background: #1E293B;
    border-color: #334155;
}

[data-theme="dark"] .scroll-to-top {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

[data-theme="dark"] .loading-overlay {
    background: rgba(15, 23, 42, 0.9);
}

[data-theme="dark"] .models-table th {
    background: #0F172A;
    color: #94A3B8;
}

[data-theme="dark"] .models-table tr:hover {
    background: rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .status-uploaded {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.25) 0%, rgba(30, 41, 59, 0.8) 100%);
    color: #FCD34D;
    border-color: rgba(252, 211, 77, 0.4);
}

[data-theme="dark"] .status-analyzed {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(30, 41, 59, 0.8) 100%);
    color: #93C5FD;
    border-color: rgba(147, 197, 253, 0.4);
}

[data-theme="dark"] .status-ready {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.25) 0%, rgba(30, 41, 59, 0.8) 100%);
    color: #86EFAC;
    border-color: rgba(134, 239, 172, 0.4);
}

[data-theme="dark"] .status-active {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.25) 0%, rgba(30, 41, 59, 0.8) 100%);
    color: #86EFAC;
    border-color: rgba(134, 239, 172, 0.4);
}

[data-theme="dark"] .status-inactive {
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.25) 0%, rgba(30, 41, 59, 0.8) 100%);
    color: #94A3B8;
    border-color: rgba(148, 163, 184, 0.4);
}

[data-theme="dark"] .stat-icon {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.2) 0%, rgba(30, 41, 59, 0.8) 100%);
}

[data-theme="dark"] .stat-icon.ready {
    background: linear-gradient(145deg, rgba(22, 163, 74, 0.25) 0%, rgba(30, 41, 59, 0.8) 100%);
}

[data-theme="dark"] .stat-icon.recent {
    background: linear-gradient(145deg, rgba(217, 119, 6, 0.25) 0%, rgba(30, 41, 59, 0.8) 100%);
}

[data-theme="dark"] .stat-icon.api {
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.25) 0%, rgba(30, 41, 59, 0.8) 100%);
}

/* Dark mode styles for stat cards */
[data-theme="dark"] .stat-card {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .timeline-icon.completed {
    background: linear-gradient(135deg, #16A34A 0%, #22C55E 100%);
}

[data-theme="dark"] .timeline-icon.pending {
    background: #334155;
    border-color: #475569;
}

[data-theme="dark"] .step-number {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .empty-state {
    border-color: #475569;
}

[data-theme="dark"] .mapping-item {
    background: #0F172A;
    border-color: #334155;
}

[data-theme="dark"] .mapping-item:hover {
    border-color: #3B82F6;
}

[data-theme="dark"] .data-table th,
[data-theme="dark"] .data-table td {
    border-bottom-color: #334155;
}

[data-theme="dark"] .data-table th {
    background: #0F172A;
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

[data-theme="dark"] .data-table code,
[data-theme="dark"] .models-table code {
    background: #334155;
    color: #93C5FD;
}

[data-theme="dark"] .endpoint-header {
    background: #0F172A;
}

[data-theme="dark"] .method-badge {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-gradient-end);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(30, 64, 175, 0.08) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 40%, #FFFFFF 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.65;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.85);
    padding: 0 2rem;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 0;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
    cursor: pointer;
}

.logo i {
    font-size: 1.35rem;
    color: var(--primary-blue);
    background: linear-gradient(135deg, #DBEAFE 0%, #EFF6FF 100%);
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
}

.logo:hover i {
    transform: scale(1.08) rotate(-3deg);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.version {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-light) 100%);
    color: white;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.25);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: var(--bg-subtle);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.nav {
    display: none;
    /* Navigation removed - app only has Models page */
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 16px;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-blue);
    background: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transform: translateY(-1px);
}

.nav-link.active {
    background: var(--bg-white);
    color: var(--primary-blue);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.nav-link i {
    font-size: 0.9rem;
    transition: transform var(--transition-fast);
}

.nav-link:hover i {
    transform: scale(1.1);
}

.header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    background: linear-gradient(135deg, #CBD5E1 0%, #94A3B8 100%);
    border-radius: 50px;
    border: none;
    cursor: pointer;
    padding: 3px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    transform: scale(1.05);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.theme-toggle-track {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50px;
    overflow: hidden;
}

.theme-toggle-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-thumb i {
    font-size: 12px;
    color: var(--accent-amber);
    transition: all 0.3s ease;
}

.theme-toggle-thumb .fa-sun {
    opacity: 1;
}

.theme-toggle-thumb .fa-moon {
    position: absolute;
    opacity: 0;
    color: #6366F1;
}

/* Dark mode toggle state */
[data-theme="dark"] .theme-toggle {
    background: linear-gradient(135deg, #312E81 0%, #4338CA 100%);
}

[data-theme="dark"] .theme-toggle-thumb {
    left: calc(100% - 22px);
    background: #1E1B4B;
}

[data-theme="dark"] .theme-toggle-thumb .fa-sun {
    opacity: 0;
}

[data-theme="dark"] .theme-toggle-thumb .fa-moon {
    opacity: 1;
    color: #A5B4FC;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #166534;
    background: linear-gradient(135deg, #DCFCE7 0%, #F0FDF4 100%);
    padding: 0.45rem 0.9rem;
    border-radius: 20px;
    border: 1px solid #86EFAC;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #EF4444;
    animation: pulse-error 2s infinite;
}

.status-dot.active {
    background-color: #22C55E;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    animation: pulse-success 2s infinite;
}

@keyframes pulse-success {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.3);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

@keyframes pulse-error {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* Main Content */
.main-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: pageSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation for child elements */
@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active>* {
    animation: staggerFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.page.active>*:nth-child(1) {
    animation-delay: 0s;
}

.page.active>*:nth-child(2) {
    animation-delay: 0.05s;
}

.page.active>*:nth-child(3) {
    animation-delay: 0.1s;
}

.page.active>*:nth-child(4) {
    animation-delay: 0.15s;
}

.page.active>*:nth-child(5) {
    animation-delay: 0.2s;
}

.page.active>*:nth-child(6) {
    animation-delay: 0.25s;
}

.page-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.page-header h2 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Page header with back button alignment */
.page-header .btn-back {
    position: relative;
    left: 0;
}

.page-header:has(.btn-back) {
    text-align: left;
}

.page-header:has(.btn-back) p {
    margin: 0;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Staggered animation for stat cards */
.stats-grid .stat-card {
    animation: cardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.stats-grid .stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stats-grid .stat-card:nth-child(2) {
    animation-delay: 0.15s;
}

.stats-grid .stat-card:nth-child(3) {
    animation-delay: 0.2s;
}

.stats-grid .stat-card:nth-child(4) {
    animation-delay: 0.25s;
}

@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-card {
    background: var(--bg-white);
    padding: 1.35rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: linear-gradient(145deg, #DBEAFE 0%, #EFF6FF 100%);
    color: var(--primary-blue);
    flex-shrink: 0;
    transition: all var(--transition-bounce);
}

.stat-card:hover .stat-icon {
    transform: scale(1.08);
}

.stat-icon.ready {
    background: linear-gradient(145deg, #DCFCE7 0%, #F0FDF4 100%);
    color: #16A34A;
}

.stat-icon.recent {
    background: linear-gradient(145deg, #FEF3C7 0%, #FFFBEB 100%);
    color: #D97706;
}

.stat-icon.api {
    background: linear-gradient(145deg, #EDE9FE 0%, #F5F3FF 100%);
    color: #7C3AED;
}

.stat-content h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Buttons */
.btn {
    padding: 0.65rem 1.35rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-normal);
    font-size: 0.85rem;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.btn:active {
    transform: scale(0.97);
}

.btn i {
    font-size: 0.9rem;
    transition: transform var(--transition-fast);
}

.btn:hover i {
    transform: scale(1.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.25), 0 1px 2px rgba(30, 64, 175, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.3), 0 2px 4px rgba(30, 64, 175, 0.15);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-blue) 100%);
}

.btn-primary:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.25);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-secondary:hover {
    background: var(--bg-subtle);
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.btn-secondary:active {
    transform: translateY(0) scale(0.97);
}

.btn-back {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    padding: 0.55rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back:hover {
    background: var(--bg-white);
    color: var(--primary-blue);
    border-color: var(--primary-soft);
    transform: translateX(-2px);
}

.btn-back i {
    transition: transform var(--transition-fast);
}

.btn-back:hover i {
    transform: translateX(-4px);
}

.btn-back:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.link-button {
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-sans);
    font-weight: 600;
    transition: all var(--transition-fast);
    position: relative;
}

.link-button::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-blue);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-fast);
}

.link-button:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.link-button:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Button sizes */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 8px;
}

.btn-lg {
    padding: 0.95rem 1.85rem;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
}

/* Quick Actions */
.quick-actions {
    background: var(--bg-white);
    padding: 1.75rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

.quick-actions h3 {
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.action-buttons {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

/* Responsive action buttons - stack on smaller screens */
@media (max-width: 600px) {
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Recent Models */
.recent-models {
    background: var(--bg-white);
    padding: 1.75rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

.recent-models h3 {
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.models-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    background: var(--bg-white);
    gap: 1.25rem;
}

.model-item:hover {
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    .model-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .model-item .action-buttons-table {
        width: 100%;
        justify-content: flex-start;
    }
}

.model-info {
    flex: 1;
    min-width: 0;
}

.model-id {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--primary-blue);
    margin-bottom: 0.25rem;
    font-weight: 500;
    opacity: 0.85;
}

.model-filename {
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-date {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.model-status {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.status-uploaded {
    background: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 100%);
    color: #B45309;
    border: 1px solid #FCD34D;
}

.status-uploaded i,
.status-analyzed i,
.status-ready i {
    font-size: 0.6rem;
}

.status-analyzed {
    background: linear-gradient(135deg, #DBEAFE 0%, #EFF6FF 100%);
    color: #1D4ED8;
    border: 1px solid #93C5FD;
}

.status-ready {
    background: linear-gradient(135deg, #DCFCE7 0%, #F0FDF4 100%);
    color: #15803D;
    border: 1px solid #86EFAC;
}

.status-active {
    background: linear-gradient(135deg, #DCFCE7 0%, #F0FDF4 100%);
    color: #15803D;
    border: 1px solid #86EFAC;
}

.status-inactive {
    background: linear-gradient(135deg, #F1F5F9 0%, #F8FAFC 100%);
    color: #64748B;
    border: 1px solid #CBD5E1;
}

/* Quick Start */
.quick-start {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

/* First-time user welcome banner */
.welcome-banner {
    background: linear-gradient(135deg, #87CEEB 0%, #E0F6FF 50%, #FFF8DC 100%);
    color: #2C3E50;
    padding: 2rem 2.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    transition: background 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sky elements container */
.sky-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* Cliff landscape */
.cliff {
    position: absolute;
    bottom: 0;
    left: 30%;
    width: 180px;
    height: 100px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 25%, #CD853F 50%, #D2691E 75%, #DEB887 100%);
    clip-path: polygon(0% 100%, 15% 85%, 30% 70%, 50% 60%, 65% 50%, 80% 45%, 90% 35%, 100% 40%, 100% 100%);
    transition: all 0.8s ease;
    box-shadow:
        inset -15px -25px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(139, 69, 19, 0.3);
    z-index: 2;
}

.cliff::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
            transparent 0%,
            rgba(255, 215, 0, 0.1) 20%,
            rgba(255, 165, 0, 0.15) 40%,
            transparent 60%,
            rgba(139, 69, 19, 0.3) 100%);
    clip-path: inherit;
    transition: all 0.8s ease;
}

/* Cliff structural details */
.cliff::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 25% 40%, rgba(101, 67, 33, 0.6) 2px, transparent 3px),
        radial-gradient(circle at 45% 60%, rgba(93, 58, 26, 0.5) 3px, transparent 4px),
        radial-gradient(circle at 70% 35%, rgba(101, 67, 33, 0.7) 2px, transparent 3px),
        radial-gradient(circle at 80% 70%, rgba(93, 58, 26, 0.4) 4px, transparent 5px),
        linear-gradient(20deg, transparent 45%, rgba(0, 0, 0, 0.1) 47%, transparent 49%),
        linear-gradient(70deg, transparent 35%, rgba(0, 0, 0, 0.15) 37%, transparent 39%);
    clip-path: inherit;
}

/* Lion scene (day time) */
.lion-scene {
    position: absolute;
    bottom: 65px;
    left: calc(30% + 90px);
    opacity: 1;
    transition: opacity 0.8s ease;
    z-index: 5;
    transform: scaleX(-1);
    /* Face towards the sun */
}

.lion {
    position: relative;
    width: 32px;
    height: 42px;
}

.lion-body {
    width: 18px;
    height: 24px;
    background: linear-gradient(145deg, #DAA520 0%, #FFD700 50%, #B8860B 100%);
    border-radius: 9px;
    position: absolute;
    bottom: 0;
    left: 7px;
    animation: lionBreathe 3s ease-in-out infinite;
    box-shadow:
        inset 2px 0 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 2px rgba(255, 215, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.lion-mane {
    position: absolute;
    width: 32px;
    height: 32px;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(218, 165, 32, 0.7) 30%, rgba(255, 215, 0, 0.5) 60%, transparent 90%);
    border-radius: 50%;
    animation: lionManeFlow 4s ease-in-out infinite;
    z-index: 1;
}

/* Add monkey chest */
.monkey-body::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 12px;
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border-radius: 4px;
    top: 8px;
    left: 3px;
}

/* Add monkey ears */
.monkey-ears {
    position: absolute;
    top: 2px;
    left: 7px;
    width: 18px;
    height: 10px;
}

.monkey-ear-left,
.monkey-ear-right {
    position: absolute;
    width: 6px;
    height: 8px;
    background: linear-gradient(145deg, #2a2a2a, #4a4a4a);
    border-radius: 50%;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.monkey-ear-left {
    left: -2px;
    transform: rotate(-30deg);
}

.monkey-ear-right {
    right: -2px;
    transform: rotate(30deg);
}

.monkey-ear-left::before,
.monkey-ear-right::before {
    content: '';
    position: absolute;
    width: 3px;
    height: 4px;
    background: #1a1a1a;
    border-radius: 50%;
    top: 2px;
    left: 1.5px;
}

.monkey-head {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #2a2a2a, #4a4a4a, #363636);
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 7px;
    animation: monkeyBreathe 3s ease-in-out infinite;
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.monkey-head::before {
    content: '';
    position: absolute;
    width: 5px;
    height: 7px;
    background: linear-gradient(180deg, #1a1a1a, #0f0f0f);
    border-radius: 0 0 3px 3px;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.1);
}

/* Add eyes to monkey */
.monkey-head::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 1px;
    background: #fff;
    border-radius: 50%;
    top: 45%;
    left: 30%;
    box-shadow: 6px 0 0 #fff;
    animation: monkeyBlink 4s ease-in-out infinite;
}

/* Add nostrils */
.monkey-nostril {
    position: absolute;
    width: 1px;
    height: 1px;
    background: #000;
    border-radius: 50%;
    top: 75%;
    left: 45%;
}

.monkey-nostril::after {
    content: '';
    position: absolute;
    width: 1px;
    height: 1px;
    background: #000;
    border-radius: 50%;
    left: 3px;
    top: 0;
}

@keyframes monkeyBlink {

    0%,
    85%,
    100% {
        opacity: 1;
    }

    90%,
    95% {
        opacity: 0;
    }
}

.monkey-arms {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
}

.monkey-arm-left,
.monkey-arm-right {
    width: 10px;
    height: 3px;
    background: linear-gradient(90deg, #2a2a2a, #4a4a4a);
    border-radius: 2px;
    position: absolute;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.monkey-arm-left {
    left: -2px;
    transform-origin: right center;
    animation: monkeyArmLeft 4s ease-in-out infinite;
}

.monkey-arm-right {
    right: -2px;
    transform-origin: left center;
    animation: monkeyArmRight 4s ease-in-out infinite;
}

.simba {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 9px;
    background: linear-gradient(45deg, #DAA520 0%, #FFD700 50%, #B8860B 100%);
    border-radius: 2px;
    animation: simbaLift 4s ease-in-out infinite;
    box-shadow:
        0 2px 4px rgba(218, 165, 32, 0.4),
        inset 0 1px 1px rgba(255, 215, 0, 0.3);
}

/* Simba's head with more detail */
.simba::before {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    background: linear-gradient(45deg, #DAA520 0%, #FFD700 70%, #FFA500 100%);
    border-radius: 50%;
    top: -5px;
    left: 1.5px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 215, 0, 0.4);
}

/* Simba's tail */
.simba::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 1px;
    background: linear-gradient(90deg, #B8860B, #DAA520);
    top: -1px;
    right: -1px;
    border-radius: 1px;
    transform: rotate(15deg);
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
}

/* Add Simba's mane (small) */
.simba-mane {
    position: absolute;
    width: 9px;
    height: 9px;
    top: -6px;
    left: 0.5px;
    background: radial-gradient(circle, rgba(184, 134, 11, 0.6) 30%, transparent 70%);
    border-radius: 50%;
    animation: simbaLift 4s ease-in-out infinite;
}

/* Add Simba's ears */
.simba-ears {
    position: absolute;
    top: -7px;
    left: 2px;
    width: 6px;
    height: 3px;
}

.simba-ear-left,
.simba-ear-right {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #B8860B;
    border-radius: 50% 50% 0 50%;
    box-shadow: inset 0 0 1px rgba(255, 215, 0, 0.3);
}

.simba-ear-left {
    left: 0;
    transform: rotate(-20deg);
}

.simba-ear-right {
    right: 0;
    transform: rotate(20deg);
}

@keyframes lionBreathe {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(1.05);
    }
}

@keyframes lionRoarToSun {

    0%,
    100% {
        transform: rotate(-15deg) scale(1);
    }

    25% {
        transform: rotate(-25deg) scale(1.08);
    }

    50% {
        transform: rotate(-20deg) scale(1.05);
    }

    75% {
        transform: rotate(-30deg) scale(1.1);
    }
}

@keyframes lionManeFlow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

@keyframes monkeyBreathe {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(1.05);
    }
}

@keyframes monkeyArmLeft {

    0%,
    100% {
        transform: rotate(-10deg);
    }

    50% {
        transform: rotate(20deg);
    }
}

@keyframes monkeyArmRight {

    0%,
    100% {
        transform: rotate(10deg);
    }

    50% {
        transform: rotate(-20deg);
    }
}

@keyframes simbaLift {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-3px);
    }
}

/* Wolf scene (night time) */
.wolf-scene {
    position: absolute;
    bottom: 65px;
    left: calc(30% + 130px);
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: 5;
}

.wolf {
    width: 36px;
    height: 26px;
    position: relative;
}

.wolf-body {
    width: 22px;
    height: 11px;
    background: linear-gradient(45deg, #C0C0C0 0%, #E6E6FA 30%, #D3D3D3 70%, #B8B8B8 100%);
    border-radius: 5px;
    position: absolute;
    bottom: 3px;
    left: 8px;
    animation: wolfBreathe 4s ease-in-out infinite;
    box-shadow:
        0 2px 4px rgba(192, 192, 192, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.4),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

/* Add wolf chest marking */
.wolf-body::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 6px;
    background: linear-gradient(45deg, #F0F0F0, #FFFFFF);
    border-radius: 4px;
    top: 2px;
    left: 7px;
    opacity: 0.8;
}

.wolf-head {
    width: 14px;
    height: 13px;
    background: linear-gradient(45deg, #C0C0C0 0%, #E6E6FA 50%, #F0F0F0 100%);
    border-radius: 7px 7px 3px 3px;
    position: absolute;
    top: 1px;
    left: 0;
    animation: wolfHowlToMoon 6s ease-in-out infinite;
    transform-origin: bottom center;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.2),
        inset 1px 1px 2px rgba(255, 255, 255, 0.5),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

/* Add wolf forehead marking */
.wolf-head::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 4px;
    background: linear-gradient(45deg, #F5F5F5, #FFFFFF);
    border-radius: 3px;
    top: 2px;
    left: 4px;
    opacity: 0.7;
}

.wolf-snout {
    width: 7px;
    height: 4px;
    background: linear-gradient(45deg, #C0C0C0 0%, #E6E6FA 70%, #F0F0F0 100%);
    border-radius: 0 3px 3px 0;
    position: absolute;
    top: 5px;
    left: -5px;
    animation: wolfHowlToMoon 6s ease-in-out infinite;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* Enhanced wolf nose */
.wolf-snout::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 1.5px;
    background: linear-gradient(45deg, #333, #000);
    border-radius: 50%;
    top: 0.5px;
    right: 0.5px;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
}

/* Add wolf nostrils */
.wolf-snout::after {
    content: '';
    position: absolute;
    width: 0.5px;
    height: 0.5px;
    background: #000;
    border-radius: 50%;
    top: 1px;
    right: 1.5px;
    box-shadow: 1px 0 0 #000;
}

.wolf-ears {
    position: absolute;
    top: 0;
    left: 2px;
}

.wolf-ear-left,
.wolf-ear-right {
    width: 3px;
    height: 6px;
    background: linear-gradient(45deg, #C0C0C0 0%, #E6E6FA 50%, #F0F0F0 100%);
    border-radius: 2px 2px 0 0;
    position: absolute;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2);
}

.wolf-ear-left {
    left: 0;
    transform: rotate(-18deg);
}

.wolf-ear-right {
    right: 0;
    transform: rotate(18deg);
}

/* Add inner ear details */
.wolf-ear-left::before,
.wolf-ear-right::before {
    content: '';
    position: absolute;
    width: 1.5px;
    height: 3px;
    background: linear-gradient(45deg, #B0B0B0, #D0D0D0);
    border-radius: 1px 1px 0 0;
    top: 1px;
    left: 0.75px;
}

.wolf-tail {
    width: 14px;
    height: 3px;
    background: linear-gradient(45deg, #C0C0C0 0%, #E6E6FA 30%, #D3D3D3 70%, #B8B8B8 100%);
    border-radius: 2px;
    position: absolute;
    bottom: 6px;
    right: -2px;
    transform-origin: left center;
    animation: wolfTailWag 3s ease-in-out infinite;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* Add tail tip */
.wolf-tail::before {
    content: '';
    position: absolute;
    width: 3px;
    height: 2px;
    background: linear-gradient(45deg, #F0F0F0, #FFFFFF);
    border-radius: 0 2px 2px 0;
    top: 0.5px;
    right: 0;
    opacity: 0.8;
}

/* Add a subtle glow effect around the wolf for nighttime */
.wolf::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: radial-gradient(ellipse, rgba(230, 230, 250, 0.3) 0%, transparent 60%);
    border-radius: 50%;
    z-index: -1;
    animation: wolfGlow 5s ease-in-out infinite;
}

/* Updated howl animation to face the moon */
@keyframes wolfHowlToMoon {

    0%,
    70%,
    100% {
        transform: rotate(0deg);
    }

    15%,
    55% {
        transform: rotate(-35deg);
        /* More dramatic upward howl towards moon */
    }
}

@keyframes wolfGlow {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

@keyframes wolfBreathe {

    0%,
    100% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(1.1);
    }
}

@keyframes wolfHowl {

    0%,
    70%,
    100% {
        transform: rotate(0deg);
    }

    15%,
    55% {
        transform: rotate(-25deg);
    }
}

@keyframes wolfTailWag {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(15deg);
    }

    75% {
        transform: rotate(-10deg);
    }
}

/* Sun styling and animations */
.sun {
    position: absolute;
    width: 80px;
    height: 80px;
    top: 20px;
    right: 80px;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s ease;
    opacity: 1;
    transform: translateY(0);
}

.sun-core {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, #FFD700, #FFA500);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 165, 0, 0.3);
    animation: sunPulse 4s ease-in-out infinite;
}

.sun-rays {
    position: absolute;
    width: 120%;
    height: 120%;
    top: -10%;
    left: -10%;
    background: conic-gradient(from 0deg,
            transparent 0deg,
            rgba(255, 215, 0, 0.3) 10deg,
            transparent 20deg,
            rgba(255, 215, 0, 0.3) 30deg,
            transparent 40deg,
            rgba(255, 215, 0, 0.3) 50deg,
            transparent 60deg,
            rgba(255, 215, 0, 0.3) 70deg,
            transparent 80deg,
            rgba(255, 215, 0, 0.3) 90deg,
            transparent 100deg,
            rgba(255, 215, 0, 0.3) 110deg,
            transparent 120deg);
    border-radius: 50%;
    animation: sunRotate 20s linear infinite;
}

@keyframes sunPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 165, 0, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 0 80px rgba(255, 165, 0, 0.4);
    }
}

@keyframes sunRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Moon styling and animations */
.moon {
    position: absolute;
    width: 70px;
    height: 70px;
    top: 25px;
    right: 85px;
    opacity: 0;
    transform: translateY(40px);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s ease;
}

.moon-surface {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 35% 35%, #F5F5F5, #E0E0E0);
    border-radius: 50%;
    box-shadow: 0 0 25px rgba(245, 245, 245, 0.4), inset -10px -10px 20px rgba(0, 0, 0, 0.1);
    animation: moonGlow 6s ease-in-out infinite;
}

.moon-craters {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.moon-craters::before,
.moon-craters::after {
    content: '';
    position: absolute;
    background: rgba(200, 200, 200, 0.3);
    border-radius: 50%;
}

.moon-craters::before {
    width: 12px;
    height: 12px;
    top: 25%;
    left: 30%;
}

.moon-craters::after {
    width: 8px;
    height: 8px;
    top: 60%;
    right: 25%;
}

@keyframes moonGlow {

    0%,
    100% {
        box-shadow: 0 0 25px rgba(245, 245, 245, 0.4), inset -10px -10px 20px rgba(0, 0, 0, 0.1);
    }

    50% {
        box-shadow: 0 0 35px rgba(245, 245, 245, 0.6), inset -10px -10px 20px rgba(0, 0, 0, 0.05);
    }
}

/* Cloud styling and animations */
.cloud {
    position: absolute;
    background: white;
    border-radius: 50px;
    opacity: 0.8;
    backdrop-filter: blur(1px);
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50px;
}

.cloud-1 {
    width: 60px;
    height: 20px;
    top: 30%;
    left: 5%;
    animation: floatCloud1 25s ease-in-out infinite;
}

.cloud-1::before {
    width: 25px;
    height: 25px;
    top: -12px;
    left: 5px;
}

.cloud-1::after {
    width: 30px;
    height: 30px;
    top: -15px;
    right: 8px;
}

.cloud-2 {
    width: 80px;
    height: 25px;
    top: 15%;
    left: 25%;
    animation: floatCloud2 30s ease-in-out infinite 5s;
}

.cloud-2::before {
    width: 35px;
    height: 35px;
    top: -17px;
    left: 8px;
}

.cloud-2::after {
    width: 40px;
    height: 40px;
    top: -20px;
    right: 10px;
}

.cloud-3 {
    width: 45px;
    height: 15px;
    top: 70%;
    left: 15%;
    animation: floatCloud3 20s ease-in-out infinite 10s;
}

.cloud-3::before {
    width: 20px;
    height: 20px;
    top: -10px;
    left: 3px;
}

.cloud-3::after {
    width: 25px;
    height: 25px;
    top: -12px;
    right: 5px;
}

.cloud-4 {
    width: 70px;
    height: 22px;
    top: 50%;
    right: 20%;
    animation: floatCloud4 35s ease-in-out infinite 15s;
}

.cloud-4::before {
    width: 30px;
    height: 30px;
    top: -15px;
    left: 7px;
}

.cloud-4::after {
    width: 35px;
    height: 35px;
    top: -17px;
    right: 8px;
}

.cloud-5 {
    width: 55px;
    height: 18px;
    top: 25%;
    right: 45%;
    animation: floatCloud5 28s ease-in-out infinite 8s;
}

.cloud-5::before {
    width: 25px;
    height: 25px;
    top: -12px;
    left: 5px;
}

.cloud-5::after {
    width: 28px;
    height: 28px;
    top: -14px;
    right: 6px;
}

@keyframes floatCloud1 {

    0%,
    100% {
        transform: translateX(0) translateY(0);
    }

    25% {
        transform: translateX(30px) translateY(-10px);
    }

    50% {
        transform: translateX(60px) translateY(5px);
    }

    75% {
        transform: translateX(30px) translateY(-5px);
    }
}

@keyframes floatCloud2 {

    0%,
    100% {
        transform: translateX(0) translateY(0);
    }

    30% {
        transform: translateX(-20px) translateY(8px);
    }

    60% {
        transform: translateX(-40px) translateY(-12px);
    }

    90% {
        transform: translateX(-10px) translateY(6px);
    }
}

@keyframes floatCloud3 {

    0%,
    100% {
        transform: translateX(0) translateY(0);
    }

    20% {
        transform: translateX(25px) translateY(-8px);
    }

    40% {
        transform: translateX(50px) translateY(3px);
    }

    60% {
        transform: translateX(35px) translateY(-15px);
    }

    80% {
        transform: translateX(15px) translateY(8px);
    }
}

@keyframes floatCloud4 {

    0%,
    100% {
        transform: translateX(0) translateY(0);
    }

    25% {
        transform: translateX(-35px) translateY(10px);
    }

    50% {
        transform: translateX(-70px) translateY(-5px);
    }

    75% {
        transform: translateX(-35px) translateY(15px);
    }
}

@keyframes floatCloud5 {

    0%,
    100% {
        transform: translateX(0) translateY(0);
    }

    33% {
        transform: translateX(20px) translateY(-12px);
    }

    66% {
        transform: translateX(-15px) translateY(8px);
    }
}

/* Banner content styling */
.banner-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
}

.welcome-banner h3 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.welcome-banner p {
    opacity: 0.85;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    max-width: 500px;
    position: relative;
    z-index: 1;
}

.welcome-banner .btn {
    position: relative;
    z-index: 1;
    background: white;
    color: var(--primary-blue);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-banner .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Dark mode transitions */
[data-theme="dark"] .welcome-banner {
    background: linear-gradient(135deg, #1a1f3a 0%, #2d3561 50%, #1e2749 100%);
    color: #E2E8F0;
}

[data-theme="dark"] .sun {
    opacity: 0;
    transform: translateY(-40px);
}

[data-theme="dark"] .moon {
    opacity: 1;
    transform: translateY(0);
}

[data-theme="dark"] .cliff {
    background: linear-gradient(135deg, #2C1810 0%, #3C2414 25%, #4A2C17 50%, #5C3317 75%, #654321 100%);
    box-shadow:
        inset -20px -30px 50px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(76, 44, 23, 0.4);
}

[data-theme="dark"] .cliff::before {
    background: linear-gradient(45deg,
            transparent 0%,
            rgba(230, 230, 250, 0.08) 20%,
            rgba(192, 192, 192, 0.12) 40%,
            transparent 60%,
            rgba(44, 24, 16, 0.5) 100%);
}

[data-theme="dark"] .lion-scene {
    opacity: 0;
}

[data-theme="dark"] .wolf-scene {
    opacity: 1;
}

[data-theme="dark"] .cloud {
    background: rgba(100, 116, 139, 0.3);
}

[data-theme="dark"] .cloud::before,
[data-theme="dark"] .cloud::after {
    background: rgba(100, 116, 139, 0.3);
}

[data-theme="dark"] .welcome-banner .btn {
    background: rgba(255, 255, 255, 0.1);
    color: #E2E8F0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .welcome-banner .btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .welcome-banner {
        padding: 1.5rem;
        min-height: 160px;
    }

    .welcome-banner h3 {
        font-size: 1.15rem;
    }

    /* Scale down sky elements for mobile */
    .sun {
        width: 60px;
        height: 60px;
        top: 15px;
        right: 20px;
    }

    .moon {
        width: 55px;
        height: 55px;
        top: 18px;
        right: 23px;
    }

    .cliff {
        width: 150px;
        height: 75px;
        left: 25%;
    }

    .cloud-1 {
        width: 40px;
        height: 15px;
    }

    .cloud-2 {
        width: 55px;
        height: 18px;
    }

    .cloud-3 {
        width: 35px;
        height: 12px;
    }

    .cloud-4 {
        width: 50px;
        height: 16px;
    }

    .cloud-5 {
        width: 40px;
        height: 14px;
    }

    .cloud-1::before {
        width: 18px;
        height: 18px;
        top: -9px;
    }

    .cloud-1::after {
        width: 20px;
        height: 20px;
        top: -10px;
    }

    .cloud-2::before {
        width: 25px;
        height: 25px;
        top: -12px;
    }

    .cloud-2::after {
        width: 28px;
        height: 28px;
        top: -14px;
    }

    .cloud-3::before {
        width: 15px;
        height: 15px;
        top: -7px;
    }

    .cloud-3::after {
        width: 17px;
        height: 17px;
        top: -8px;
    }

    .cloud-4::before {
        width: 22px;
        height: 22px;
        top: -11px;
    }

    .cloud-4::after {
        width: 25px;
        height: 25px;
        top: -12px;
    }

    .cloud-5::before {
        width: 18px;
        height: 18px;
        top: -9px;
    }

    .cloud-5::after {
        width: 20px;
        height: 20px;
        top: -10px;
    }
}

@media (max-width: 480px) {
    .welcome-banner {
        min-height: 140px;
    }

    /* Further reduce sky elements on small phones */
    .sun {
        width: 45px;
        height: 45px;
        top: 10px;
        right: 15px;
    }

    .moon {
        width: 40px;
        height: 40px;
        top: 13px;
        right: 18px;
    }

    .cliff {
        width: 130px;
        height: 60px;
        left: 20%;
    }

    .lion-scene {
        bottom: 38px;
        left: calc(20% + 65px);
        transform: scale(0.7);
    }

    .wolf-scene {
        bottom: 33px;
        left: calc(20% + 90px);
        transform: scale(0.7);
    }

    .cloud-1 {
        width: 30px;
        height: 12px;
    }

    .cloud-2 {
        width: 40px;
        height: 14px;
    }

    .cloud-3 {
        width: 25px;
        height: 10px;
    }

    .cloud-4 {
        width: 35px;
        height: 12px;
    }

    .cloud-5 {
        width: 30px;
        height: 11px;
    }
}

.quick-start h3 {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-start h3::before {
    content: '🚀';
    font-size: 1.2rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    position: relative;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    padding: 1.25rem 0.75rem;
    background: transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: relative;
    z-index: 1;
}

.step:hover {
    background: rgba(241, 245, 249, 0.5);
}

.step-number {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.3);
    transition: all var(--transition-bounce);
    position: relative;
    z-index: 2;
}

.step:nth-child(2) .step-number {
    background: linear-gradient(135deg, var(--primary-light) 0%, #60A5FA 100%);
}

.step:nth-child(3) .step-number {
    background: linear-gradient(135deg, var(--accent-teal) 0%, #14B8A6 100%);
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3);
}

.step:nth-child(4) .step-number {
    background: linear-gradient(135deg, #16A34A 0%, #22C55E 100%);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3);
}

.step:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.35);
}

.step-content {
    max-width: 180px;
}

.step-content h4 {
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.step-content h4 i {
    display: none;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.5;
}

/* Upload Zone */
.upload-container {
    max-width: 560px;
    margin: 0 auto;
}

.upload-zone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2rem;
    text-align: center;
    background: var(--bg-white);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.02) 0%, rgba(59, 130, 246, 0.04) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.upload-zone::after {
    content: 'Click or drop file here';
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.upload-zone:hover {
    border-color: var(--primary-soft);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.08);
}

.upload-zone:hover::before {
    opacity: 1;
}

.upload-zone:hover::after {
    opacity: 1;
}

.upload-zone:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
    border-color: var(--primary-soft);
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.02) 0%, transparent 100%);
}

/* Keyboard focus state for better accessibility */
.upload-zone:focus-visible .upload-icon {
    transform: scale(1.05);
    opacity: 1;
}

.upload-zone.dragover {
    border-color: var(--primary-blue);
    border-style: solid;
    background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 100%);
    transform: scale(1.02);
    box-shadow: 0 12px 32px rgba(30, 64, 175, 0.15);
}

.upload-zone.dragover::before {
    opacity: 1;
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--primary-blue);
    margin-bottom: 1.25rem;
    opacity: 0.8;
    transition: all var(--transition-normal);
}

.upload-zone:hover .upload-icon {
    transform: scale(1.1);
    opacity: 1;
}

.upload-zone.dragover .upload-icon {
    transform: scale(1.2) translateY(-8px);
    animation: float 1.2s ease-in-out infinite;
    color: var(--primary-dark);
}

@keyframes float {

    0%,
    100% {
        transform: scale(1.2) translateY(-8px);
    }

    50% {
        transform: scale(1.2) translateY(-16px);
    }
}

.upload-content h3 {
    margin-bottom: 0.6rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
}

.upload-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
}

.file-info {
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    position: relative;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.file-info p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Progress */
.upload-progress {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
    border: 1px solid var(--border-light);
    animation: fadeIn 0.3s ease;
}

.upload-progress h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.upload-progress h3::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-soft);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.progress-bar {
    width: 100%;
    height: 10px;
    background: #E2E8F0;
    border-radius: 10px;
    margin: 1.25rem 0;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg,
            var(--primary-blue) 0%,
            var(--primary-soft) 25%,
            var(--accent-teal) 50%,
            var(--primary-soft) 75%,
            var(--primary-blue) 100%);
    background-size: 300% 100%;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    width: 0%;
    border-radius: 10px;
    animation: shimmer 2s linear infinite;
    box-shadow: 0 0 12px rgba(30, 64, 175, 0.4);
}

@keyframes shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.progress-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

/* Progress steps indicator */
.progress-steps {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-light);
}

.progress-step i {
    font-size: 0.85rem;
}

.progress-step.active {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    color: var(--primary-blue);
    border-color: var(--primary-soft);
    transform: scale(1.05);
}

.progress-step.completed {
    background: linear-gradient(135deg, #DCFCE7 0%, #F0FDF4 100%);
    color: #166534;
    border-color: #86EFAC;
}

.progress-step.completed i {
    color: #22C55E;
}

@media (max-width: 600px) {
    .progress-steps {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .progress-step {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

/* Upload Result */
.upload-result {
    background: var(--bg-white);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    animation: fadeIn 0.4s ease;
}

.upload-result .text-center h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.success-icon {
    font-size: 2.75rem;
    color: #22C55E;
    margin-bottom: 1rem;
    animation: successPop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-block;
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-info {
    background: linear-gradient(135deg, #F0FDF4 0%, var(--bg-subtle) 100%);
    padding: 1rem 1.15rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    border: 1px solid #BBF7D0;
    text-align: left;
}

.result-info p {
    margin: 0.3rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

.model-id-code {
    background: var(--bg-subtle);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    border: 1px solid var(--border-light);
}

/* Models Controls */
.models-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
    flex-direction: column;
    align-items: stretch;
}

.models-controls>div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Upload folder warning message */
.upload-folder-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #e8f4fc;
    border: 1px solid #b8daef;
    border-radius: var(--radius-sm);
    color: #1e5f8d;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.upload-folder-warning i {
    color: #3498db;
    font-size: 1rem;
}

.search-filters {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.search-filters input,
.search-filters select {
    padding: 0.7rem 1.1rem;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    background: var(--bg-white);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-filters input:focus,
.search-filters select:focus {
    outline: none;
    border-color: var(--primary-soft);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.08);
}

.search-filters input {
    min-width: 200px;
    max-width: 100%;
    flex: 1;
}

.search-filters input::placeholder {
    color: var(--text-muted);
}

/* Status Toggle - Segmented Control */
.status-toggle {
    display: inline-flex;
    background: var(--bg-subtle);
    border-radius: 10px;
    padding: 3px;
    border: 1.5px solid var(--border-light);
    position: relative;
    gap: 2px;
}

.status-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.status-toggle-btn i {
    font-size: 0.78rem;
    transition: all 0.25s ease;
}

.status-toggle-btn:hover:not(.active) {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.04);
}

.status-toggle-btn.active[data-value="active"] {
    background: linear-gradient(135deg, #DCFCE7 0%, #D1FAE5 100%);
    color: #15803D;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.15), 0 0 0 1px rgba(22, 163, 74, 0.1);
}

.status-toggle-btn.active[data-value="active"] i {
    color: #22C55E;
}

.status-toggle-btn.active[data-value="inactive"] {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A40 100%);
    color: #92400E;
    box-shadow: 0 1px 3px rgba(180, 83, 9, 0.15), 0 0 0 1px rgba(180, 83, 9, 0.1);
}

.status-toggle-btn.active[data-value="inactive"] i {
    color: #F59E0B;
}

.models-actions {
    display: flex;
    gap: 0.6rem;
}

/* Models Table */
.models-table-container {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid var(--border-light);
    position: relative;
}

/* Horizontal scroll indicator for wide tables on desktop */
@media (min-width: 769px) {
    .models-table-container {
        overflow-x: auto;
    }

    .models-table-container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9));
        pointer-events: none;
        opacity: 0;
        transition: opacity var(--transition-fast);
    }

    .models-table-container.has-scroll::after {
        opacity: 1;
    }
}

.models-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Column widths for fixed layout */
.models-table th:nth-child(1),
.models-table td:nth-child(1) {
    width: 14%;
}

/* Model ID */
.models-table th:nth-child(2),
.models-table td:nth-child(2) {
    width: 24%;
}

/* Name / Filename */
.models-table th:nth-child(3),
.models-table td:nth-child(3) {
    width: 11%;
}

/* Created */
.models-table th:nth-child(4),
.models-table td:nth-child(4) {
    width: 11%;
}

/* Last Updated */
.models-table th:nth-child(5),
.models-table td:nth-child(5) {
    width: 8%;
    text-align: center;
}

/* Status */
.models-table th:nth-child(6),
.models-table td:nth-child(6) {
    width: 13%;
    padding-right: 1.5rem;
}

/* Actions */
.models-table th:nth-child(7),
.models-table td:nth-child(7) {
    width: 19%;
}

/* Actions */

.models-table th,
.models-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.models-table th {
    background: var(--bg-subtle);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.models-table tbody tr {
    transition: all var(--transition-fast);
}

.models-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(30, 64, 175, 0.03) 0%, transparent 100%);
}

.models-table tbody tr:hover td:first-child {
    padding-left: 1.5rem;
}

.models-table tr:last-child td {
    border-bottom: none;
}

/* Folder row in models table */
.folder-row {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03) 0%, rgba(99, 102, 241, 0.02) 100%);
    transition: all var(--transition-normal);
}

.folder-row:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
    transform: translateX(2px);
}

.folder-table-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.folder-icon-wrapper {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #6366f1 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.folder-icon-wrapper i {
    color: white;
    font-size: 1.1rem;
}

.folder-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.folder-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.folder-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.folder-arrow {
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.folder-row:hover .folder-arrow {
    color: var(--primary-blue);
    transform: translateX(4px);
}

.btn-folder-open {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
    gap: 0.4rem;
}

/* Responsive table cards for mobile */
@media (max-width: 768px) {
    .models-table-container {
        background: transparent;
        box-shadow: none;
        border: none;
    }

    .models-table {
        display: block;
    }

    .models-table thead {
        display: none;
    }

    .models-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .models-table tr {
        display: block;
        background: var(--bg-white);
        border-radius: var(--radius-sm);
        padding: 1rem;
        box-shadow: var(--shadow-card);
        border: 1px solid var(--border-light);
    }

    .models-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-light);
    }

    .models-table td:last-child {
        border-bottom: none;
        justify-content: flex-start;
        padding-top: 0.75rem;
    }

    .models-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.75rem;
        text-transform: uppercase;
    }
}

.cell-reference {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--primary-blue);
    font-weight: 500;
    background: rgba(30, 64, 175, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

/* Truncated model ID in table */
.model-id-truncated {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.model-id-truncated:hover {
    opacity: 0.8;
}

/* Model ID detail popup */
.model-id-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9998;
    animation: fadeIn 0.15s ease;
}

.model-id-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    min-width: 360px;
    max-width: 520px;
    animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
    from {
        transform: translate(-50%, -50%) scale(0.92);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.model-id-popup h4 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.model-id-popup .popup-field {
    margin-bottom: 0.75rem;
}

.model-id-popup .popup-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.model-id-popup .popup-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-subtle);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

.model-id-popup .popup-value .copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-blue);
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.model-id-popup .popup-value .copy-btn:hover {
    background: rgba(30, 64, 175, 0.1);
}

.model-id-popup .popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.version-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-gray);
    border-radius: 12px;
}

[data-theme="dark"] .version-badge {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.version-badge-active {
    background: linear-gradient(135deg, #DCFCE7 0%, #F0FDF4 100%);
    color: #15803D;
    font-weight: 700;
}

[data-theme="dark"] .version-badge-active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
    color: #4ADE80;
}

.version-count-secondary {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: 0.3rem;
    font-weight: 500;
}

/* Auto-suggestion styling */
.auto-suggestion {
    background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 100%);
    border: 1px solid var(--primary-soft);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary-blue);
}

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

/* Data type badges */
.data-type-badge {
    display: inline-block;
    background: #E2E8F0;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    margin-left: 0.5rem;
    text-transform: lowercase;
    vertical-align: middle;
}

.data-type-badge[data-type="array"] {
    background: linear-gradient(135deg, #EDE9FE 0%, #F5F3FF 100%);
    color: #6D28D9;
}

.data-type-badge[data-type="number"] {
    background: linear-gradient(135deg, #DCFCE7 0%, #F0FDF4 100%);
    color: #15803D;
}

.data-type-badge[data-type="text"] {
    background: linear-gradient(135deg, #DBEAFE 0%, #EFF6FF 100%);
    color: #1D4ED8;
}

.data-type-badge[data-type="boolean"] {
    background: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 100%);
    color: #B45309;
}

/* Range input table styling */
.range-input-table {
    margin-top: 0.75rem;
    background: #FAFBFC;
    border-radius: var(--radius-sm);
    padding: 1rem;
    border: 1px solid var(--border-light);
}

.range-input-table .table-dimensions {
    margin-bottom: 0.75rem;
}

.range-input-table .dimension-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-light) 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
}

.range-input-table .table-container {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: auto;
    max-height: 350px;
    background: var(--bg-white);
}

.range-input-table .range-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.range-input-table .range-table thead th {
    background: #F8FAFC;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--text-secondary);
    font-size: 0.75rem;
    min-width: 50px;
}

.range-input-table .range-table tbody th {
    background: #F8FAFC;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    min-width: 40px;
    position: sticky;
    left: 0;
    z-index: 1;
}

.range-input-table .range-table td {
    padding: 2px;
    border: 1px solid var(--border-light);
}

.range-input-table .table-cell-input {
    width: 100%;
    border: none;
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    min-width: 70px;
    background: transparent;
    transition: all 0.15s ease;
}

.range-input-table .table-cell-input:hover {
    background: #F8FAFC;
}

.range-input-table .table-cell-input:focus {
    background: #EFF6FF;
    outline: none;
    box-shadow: inset 0 0 0 2px var(--primary-soft);
}

.range-input-table .table-cell-input::placeholder {
    color: var(--text-muted);
}

.range-input-table .table-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.range-input-table .table-actions .btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
}

.range-input-table .range-table tbody tr:nth-child(even) td {
    background: #FAFBFC;
}

.range-input-table .range-table tbody tr:hover td {
    background: #EFF6FF;
}

.action-buttons-table {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.action-buttons-table .btn {
    padding: 0.45rem 0.7rem;
    font-size: 0.75rem;
    min-width: 34px;
    justify-content: center;
    border-radius: 8px;
}

.action-buttons-table .btn i {
    font-size: 0.85rem;
}

.action-buttons-table .btn:hover {
    transform: translateY(-2px);
}

/* Mobile - expand action buttons for better touch targets */
@media (max-width: 768px) {
    .action-buttons-table {
        width: 100%;
        gap: 0.5rem;
    }

    .action-buttons-table .btn {
        flex: 1;
        min-width: 70px;
        padding: 0.6rem 0.75rem;
    }
}

/* Tabs */
.tabs {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-subtle);
    padding: 0.5rem;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
}

.tab-buttons::-webkit-scrollbar {
    display: none;
}

/* Tab scroll indicators */
.tab-buttons-wrapper {
    position: relative;
}

.tab-buttons-wrapper::before,
.tab-buttons-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.tab-buttons-wrapper::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg-subtle) 20%, transparent);
}

.tab-buttons-wrapper::after {
    right: 0;
    background: linear-gradient(-90deg, var(--bg-subtle) 20%, transparent);
}

.tab-buttons-wrapper.scroll-left::before,
.tab-buttons-wrapper.scroll-right::after {
    opacity: 1;
}

.tab-button {
    padding: 0.7rem 1.35rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    white-space: nowrap;
    position: relative;
}

.tab-button:hover {
    color: var(--primary-blue);
    background: rgba(255, 255, 255, 0.8);
}

.tab-button:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
    z-index: 1;
}

.tab-button.active {
    color: var(--primary-blue);
    background: var(--bg-white);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

/* Tab active indicator animation */
.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    height: 2px;
    background: var(--primary-blue);
    border-radius: 2px;
}

.tab-pane {
    display: none;
    padding: 2rem;
    animation: tabFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-pane.active {
    display: block;
}

.tab-pane h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.tab-pane h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: 0.85rem;
    color: var(--text-primary);
}

/* Model Info Header */
.model-info-header {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.model-info-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-soft), var(--accent-teal));
}

.model-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.model-meta {
    flex: 1;
}

.model-meta h3 {
    font-size: 1.45rem;
    margin-bottom: 0.65rem;
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.model-meta p {
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.model-meta p strong {
    color: var(--text-primary);
    font-weight: 600;
}

.model-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

/* Timeline */
.timeline {
    margin: 1.5rem 0;
    position: relative;
    padding-left: 0;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    position: relative;
    transition: all var(--transition-normal);
}

.timeline-item:hover {
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.timeline-icon.completed {
    background: linear-gradient(135deg, #16A34A 0%, #22C55E 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.timeline-icon.pending {
    background: var(--bg-subtle);
    color: var(--text-muted);
    border: 2px dashed var(--border-medium);
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-content h4 {
    margin-bottom: 0.2rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-content p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.timeline-content small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Info Boxes */
.info-box {
    background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.35rem;
    margin: 1.25rem 0;
}

.info-box-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-blue);
    font-size: 0.95rem;
}

.info-box-header i {
    color: #F59E0B;
    font-size: 1rem;
}

.info-box-content p {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.info-box-content ul {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
}

.info-box-content li {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.info-box-content code {
    background: rgba(30, 64, 175, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--primary-blue);
}

.info-box-content small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.info-box h4 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.info-box h4 i {
    font-size: 0.9rem;
}

.info-box p {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-primary);
}

/* Folder Select Row */
.folder-select-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.folder-select-row select {
    flex: 1;
}

.folder-select-row .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-icon-text {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.7rem 0.9rem;
}

.warning-box {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF9E7 100%);
    border-color: rgba(251, 191, 36, 0.4);
}

.warning-box h4 {
    color: #B45309;
}

.success-box {
    background: linear-gradient(135deg, #F0FDF4 0%, #ECFDF5 100%);
    border-color: rgba(134, 239, 172, 0.5);
}

.success-box h4 {
    color: #166534;
}

.error-box {
    background: linear-gradient(135deg, #FEF2F2 0%, #FFFBFB 100%);
    border-color: rgba(254, 202, 202, 0.6);
}

.error-box h4 {
    color: #B91C1C;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: var(--bg-subtle);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.02) 0%, transparent 100%);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.35rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.form-group label small {
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.92rem;
    background: var(--bg-white);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:hover {
    border-color: var(--border-medium);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-soft);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.08);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background: var(--bg-subtle);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Calculator */
.calculator-container {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.75rem;
    max-width: 1100px;
    align-items: start;
}

/* Responsive calculator - single column on smaller screens */
@media (max-width: 900px) {
    .calculator-container {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
}

.calculator-form {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.calculator-form h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.calculator-results {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    position: sticky;
    top: 90px;
    animation: resultsSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Highlight animation for new results */
.calculator-results.result-highlight {
    animation: resultHighlight 1.5s ease-out;
}

@keyframes resultHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4), var(--shadow-card);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.1), var(--shadow-hover);
    }

    100% {
        box-shadow: var(--shadow-card);
    }
}

@keyframes resultsSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Results display success animation */
.calculator-results .results-display {
    animation: resultsFadeIn 0.5s ease 0.1s backwards;
}

@keyframes resultsFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Result items stagger animation */
.calculator-results .result-item {
    animation: resultItemSlide 0.3s ease backwards;
}

.calculator-results .result-item:nth-child(1) {
    animation-delay: 0.1s;
}

.calculator-results .result-item:nth-child(2) {
    animation-delay: 0.15s;
}

.calculator-results .result-item:nth-child(3) {
    animation-delay: 0.2s;
}

.calculator-results .result-item:nth-child(4) {
    animation-delay: 0.25s;
}

.calculator-results .result-item:nth-child(5) {
    animation-delay: 0.3s;
}

@keyframes resultItemSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.calculator-results h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.output-selection {
    margin: 1.25rem 0;
    padding: 1.15rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.output-selection h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.6rem;
    margin-top: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-light);
    transition: all var(--transition-normal);
    cursor: pointer;
    overflow: hidden;
    min-width: 0;
}

.checkbox-item:hover {
    border-color: var(--primary-soft);
    background: var(--bg-subtle);
}

.checkbox-item:has(input:checked) {
    border-color: var(--primary-blue);
    background: linear-gradient(135deg, #EFF6FF 0%, #FFFFFF 100%);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.08);
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
    margin-top: 3px;
    accent-color: var(--primary-blue);
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-item label {
    cursor: pointer;
    flex: 1;
    font-size: 0.88rem;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

.checkbox-item label small {
    display: block;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calculate-button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
    letter-spacing: -0.01em;
}

.calculate-button i {
    font-size: 1.1rem;
}

/* ===== Calculator Version Dropdown (Custom) ===== */
.calc-version-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.calc-version-section-title {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calc-version-section-title i {
    color: var(--primary-blue);
    font-size: 0.85rem;
}

/* Wrapper */
.cvd-wrapper {
    position: relative;
}

/* Trigger button */
.cvd-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--bg-subtle);
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.cvd-trigger:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.1);
}

.cvd-trigger--static {
    cursor: default;
}

.cvd-trigger--static:hover {
    border-color: var(--border-light);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.cvd-trigger-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.cvd-trigger-version {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-blue);
    flex-shrink: 0;
}

.cvd-trigger-active-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    flex-shrink: 0;
}

.cvd-trigger-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cvd-trigger-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.cvd-trigger-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-white);
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
    border: 1px solid var(--border-light);
}

.cvd-chevron {
    font-size: 0.6rem;
    color: var(--text-muted);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.cvd-open .cvd-chevron {
    transform: rotate(180deg);
}

/* Dropdown panel */
.cvd-panel {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
}

.cvd-open .cvd-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown items */
.cvd-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.cvd-item:hover {
    background: var(--bg-subtle);
}

.cvd-item--selected {
    background: rgba(59, 130, 246, 0.06);
}

.cvd-item--selected:hover {
    background: rgba(59, 130, 246, 0.1);
}

.cvd-item-version {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-secondary);
    min-width: 28px;
    font-family: var(--font-mono, monospace);
}

.cvd-item--selected .cvd-item-version {
    color: var(--primary-blue);
}

.cvd-item-name {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cvd-item-active {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #16a34a;
    background: rgba(34, 197, 94, 0.1);
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.cvd-item-check {
    font-size: 0.75rem;
    color: var(--primary-blue);
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.cvd-item--selected .cvd-item-check {
    opacity: 1;
}

/* Dark mode */
[data-theme="dark"] .calc-version-section {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .cvd-trigger {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-medium);
}

[data-theme="dark"] .cvd-trigger:hover {
    border-color: var(--primary-light);
}

[data-theme="dark"] .cvd-trigger--static:hover {
    border-color: var(--border-medium);
}

[data-theme="dark"] .cvd-trigger-count {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-medium);
}

[data-theme="dark"] .cvd-panel {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

[data-theme="dark"] .cvd-item--selected {
    background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .cvd-item--selected:hover {
    background: rgba(59, 130, 246, 0.15);
}

.results-display {
    padding: 1.5rem;
    background: linear-gradient(135deg, #F0FDF4 0%, #ECFDF5 100%);
    border: 1px solid #86EFAC;
    border-radius: var(--radius-md);
    margin: 1.25rem 0;
}

.results-display h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.15rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
    color: #166534;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    padding: 0.6rem 0.85rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(3px);
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.result-value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: #166534;
    font-size: 0.95rem;
    background: rgba(34, 197, 94, 0.12);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
}

/* Code Blocks */
.code-block {
    background: linear-gradient(145deg, #1E293B 0%, #0F172A 100%);
    color: #E2E8F0;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid #334155;
    position: relative;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-soft), var(--accent-teal));
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
}

/* Loading and Toasts */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.loading-overlay.show {
    display: flex;
    animation: fadeInOverlay 0.25s ease forwards;
}

/* Prevent body scroll when loading */
body.loading-active {
    overflow: hidden;
    pointer-events: none;
}

body.loading-active .loading-overlay {
    pointer-events: auto;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.loading-spinner {
    background: var(--bg-white);
    padding: 2.25rem 3rem;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    border: 1px solid var(--border-light);
    animation: spinnerIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes spinnerIn {
    from {
        transform: scale(0.9) translateY(10px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.loading-spinner i {
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    display: block;
    animation: spinPulse 1s ease-in-out infinite;
}

@keyframes spinPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.loading-spinner p {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.92rem;
    min-width: 150px;
    text-align: center;
}

/* Toast container for stacking */
.toast-container {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - 3rem);
}

.toast {
    position: relative;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    display: none;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto;
    transform-origin: top right;
}

.toast.show {
    display: flex;
    animation: toastSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.hiding {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* Toast progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    animation: toastProgress 5s linear forwards;
}

@keyframes toastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.toast-error {
    background: rgba(254, 242, 242, 0.95);
    color: #B91C1C;
    border: 1px solid #FECACA;
}

.toast-error i {
    color: #EF4444;
    font-size: 1.1rem;
}

.toast-success {
    background: rgba(240, 253, 244, 0.95);
    color: #166534;
    border: 1px solid #BBF7D0;
}

.toast-success i {
    color: #22C55E;
    font-size: 1.1rem;
}

.toast button {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: auto;
    color: inherit;
    opacity: 0.5;
    transition: all var(--transition-fast);
    padding: 0.25rem;
    line-height: 1;
    border-radius: 4px;
}

.toast button:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

/* Toast position on mobile - bottom of screen for easier reach */
@media (max-width: 480px) {
    .toast-container {
        top: auto;
        bottom: 1.5rem;
        left: 1rem;
        right: 1rem;
        max-width: none;
        width: auto;
        flex-direction: column-reverse;
    }

    .toast {
        transform-origin: bottom center;
    }

    @keyframes toastSlideIn {
        from {
            transform: translateY(100%);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes toastSlideOut {
        from {
            transform: translateY(0);
            opacity: 1;
        }

        to {
            transform: translateY(100%);
            opacity: 0;
        }
    }
}

/* Responsive Design */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .step {
        background: var(--bg-white);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-card);
    }

    .step:hover {
        background: var(--bg-white);
        box-shadow: var(--shadow-hover);
    }

    .calculator-container {
        grid-template-columns: 1fr;
    }

    .calculator-results {
        position: static;
    }
}

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

    .header-content {
        flex-wrap: wrap;
        padding: 0.65rem 0;
    }

    .logo h1 {
        font-size: 0.95rem;
    }

    .logo i {
        padding: 0.5rem;
        font-size: 1.15rem;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        padding: 0.35rem;
        margin-top: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Start hidden on mobile - will be toggled by JS */
        display: none;
    }

    .nav.show {
        display: flex;
        animation: navSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .nav::-webkit-scrollbar {
        display: none;
    }

    @keyframes navSlideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-link {
        padding: 0.55rem 0.9rem;
        font-size: 0.82rem;
    }

    .nav-link span {
        display: inline;
    }

    .header-actions {
        display: flex;
        align-items: center;
    }

    .header-actions .status-indicator {
        display: none;
    }

    .main-content {
        padding: 1.5rem 1rem 3rem;
    }

    .page-header {
        text-align: left;
        margin-bottom: 1.75rem;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }

    .page-header p {
        margin: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem 1.15rem;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .stat-content h3 {
        font-size: 1.4rem;
    }

    .steps {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .step {
        padding: 1rem 0.5rem;
    }

    .step-number {
        width: 42px;
        height: 42px;
    }

    .step-content h4 {
        font-size: 0.82rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .models-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .search-filters {
        flex-direction: column;
        gap: 0.6rem;
    }

    .search-filters input {
        min-width: auto;
    }

    .models-actions {
        flex-direction: column;
    }

    .models-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .tab-buttons {
        padding: 0.35rem;
        gap: 0.15rem;
    }

    .tab-button {
        padding: 0.6rem 0.85rem;
        font-size: 0.75rem;
    }

    .tab-pane {
        padding: 1.25rem;
    }

    .upload-container {
        max-width: 100%;
    }

    .upload-zone {
        padding: 2rem 1.25rem;
    }

    .quick-actions,
    .recent-models,
    .quick-start {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .stat-card {
        flex-direction: row;
        gap: 1rem;
    }

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

    .step {
        flex-direction: row;
        text-align: left;
        padding: 1rem;
        gap: 1rem;
    }

    .step-content {
        max-width: none;
    }

    .quick-actions,
    .recent-models,
    .quick-start {
        padding: 1.25rem;
        border-radius: var(--radius-md);
    }

    .model-actions {
        flex-direction: column;
        width: 100%;
    }

    .model-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    animation: modalOverlayIn 0.25s ease;
}

@keyframes modalOverlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
    max-width: 560px;
    width: 100%;
    max-height: calc(100vh - 3rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalContentIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalContentIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(16px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 1.35rem 1.75rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-subtle);
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.modal-header h3 i {
    font-size: 1rem;
    color: var(--primary-blue);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    background: var(--border-light);
    color: var(--text-primary);
    transform: scale(1.05);
}

.modal-close:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Modal body scroll indicator */
.modal-body {
    position: relative;
}

.modal-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, var(--bg-white));
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.modal-body.has-scroll::after {
    opacity: 1;
}

.modal-body {
    padding: 1.75rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.15rem 1.75rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    background: var(--bg-subtle);
    flex-shrink: 0;
}

/* Modal responsive */
@media (max-width: 480px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        max-height: 92vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-top-left-radius: var(--radius-xl);
        border-top-right-radius: var(--radius-xl);
        animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes modalSlideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }
}

/* Mapping specific styles */
.mapping-section {
    margin-bottom: 2rem;
}

.mapping-preview {
    background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 100%);
    border: 1px solid var(--primary-soft);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

.mapping-preview h5 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Enhanced form controls for modals */
.modal-body .form-control {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.modal-body .form-control:focus {
    outline: none;
    border-color: var(--primary-soft);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-body .form-group {
    margin-bottom: 1.5rem;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* API Docs styling */
.api-docs-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    padding: 2.25rem;
}

.api-overview {
    margin-bottom: 2.5rem;
}

.api-overview h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    margin-top: 1.75rem;
}

.api-overview h3:first-child {
    margin-top: 0;
}

.api-overview code {
    display: inline-block;
    background: var(--bg-subtle);
    color: var(--primary-blue);
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    border: 1px solid var(--border-light);
}

.api-overview p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
}

.endpoints-list {
    margin-top: 1.5rem;
}

.endpoints-list h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.endpoints-list>p {
    color: var(--text-secondary) !important;
    margin-bottom: 2rem;
}

/* Endpoint items - dynamic content */
.endpoint-item {
    background: var(--bg-white) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-card) !important;
    margin-bottom: 1.5rem !important;
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.endpoint-item:hover {
    box-shadow: var(--shadow-soft) !important;
}

.endpoint-header {
    padding: 1.5rem !important;
    border-bottom: 1px solid var(--border-light) !important;
    background: #FAFBFC !important;
}

.method-badge {
    padding: 0.3rem 0.85rem !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.03em;
}

.endpoint-path {
    background: var(--bg-white) !important;
    padding: 0.5rem 0.85rem !important;
    border-radius: var(--radius-sm) !important;
    font-family: 'SF Mono', 'Monaco', 'Courier', monospace !important;
    font-size: 0.85rem;
    border: 1px solid var(--border-light);
}

.endpoint-content {
    padding: 1.5rem !important;
}

.endpoint-content h5 {
    margin-bottom: 1rem !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Usage examples - dynamic content */
.usage-examples {
    background: var(--bg-white) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-card) !important;
    padding: 2rem !important;
    border: 1px solid var(--border-light);
}

.usage-examples h4 {
    margin-bottom: 1.5rem !important;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.workflow-step {
    margin-bottom: 2rem !important;
}

.workflow-step h5 {
    color: var(--primary-blue) !important;
    margin-bottom: 1rem !important;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Grid layout for cell summary - dynamic content */
.grid {
    display: grid;
}

.info-box .grid>div {
    text-align: center !important;
    padding: 1.25rem !important;
    background: #F8FAFC !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border-light);
}

.info-box .grid>div>div:first-child {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.25rem;
}

.info-box .grid>div>div:last-child {
    font-size: 0.8rem !important;
    color: var(--text-secondary) !important;
}

/* Details/Summary styling */
details {
    margin-top: 1.5rem;
}

details summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    padding: 0.75rem;
    background: #F8FAFC;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

details summary:hover {
    background: #F1F5F9;
}

details[open] summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}

details[open] .code-block {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: 0;
}

/* Inputs container styling */
.inputs-container {
    margin-bottom: 1.5rem;
}

.inputs-container .form-group {
    background: #FAFBFC;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 1rem;
}

.inputs-container .form-group label {
    margin-bottom: 0.75rem;
}

.inputs-container .form-group label small {
    color: var(--text-muted) !important;
}

/* Calculator form specific styles */
#calculation-form h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

#calculation-form h4:first-child {
    margin-top: 0;
}

/* Override inline colors in dynamic content */
[style*="color: #6b7280"] {
    color: var(--text-secondary) !important;
}

[style*="color: #374151"] {
    color: var(--text-primary) !important;
}

[style*="color: #667eea"] {
    color: var(--primary-blue) !important;
}

[style*="color: #4ade80"] {
    color: #22C55E !important;
}

[style*="color: #f59e0b"] {
    color: #F59E0B !important;
}

[style*="color: #8b5cf6"] {
    color: #7C3AED !important;
}

[style*="background-color: #f9fafb"] {
    background-color: #F8FAFC !important;
}

[style*="background-color: #f0f9ff"] {
    background-color: #EFF6FF !important;
}

/* Textarea styling */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* Select dropdown styling */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Small text helper */
small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Links styling */
a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-subtle);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 5px;
    border: 2px solid var(--bg-subtle);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection styling */
::selection {
    background: rgba(30, 64, 175, 0.15);
    color: var(--primary-dark);
}

/* Skeleton Loading States */
.skeleton {
    background: linear-gradient(90deg,
            var(--bg-subtle) 0%,
            rgba(255, 255, 255, 0.5) 50%,
            var(--bg-subtle) 100%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin: 0.25rem 0;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 0.5rem;
}

.skeleton-card {
    height: 100px;
    width: 100%;
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Empty State Styling */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.02) 0%, transparent 100%);
    border-radius: var(--radius-lg);
}

.empty-state-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--bg-subtle) 0%, var(--bg-gradient-start) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    color: var(--primary-soft);
    border: 2px dashed var(--border-light);
    animation: emptyStatePulse 3s ease-in-out infinite;
}

@keyframes emptyStatePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.empty-state h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.65rem;
}

.empty-state p {
    font-size: 0.92rem;
    max-width: 400px;
    margin: 0 auto 1.75rem;
    line-height: 1.65;
}

.empty-state .btn {
    margin: 0.35rem;
}

/* Small empty state variant for inline use */
.empty-state-inline {
    padding: 2rem 1.5rem;
}

.empty-state-inline .empty-state-icon {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.3);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.4);
}

.scroll-to-top:active {
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .scroll-to-top {
        /* Position above mobile toast area */
        bottom: 6rem;
        right: 1.25rem;
        width: 44px;
        height: 44px;
    }

    /* Move higher when toast is visible */
    .scroll-to-top.toast-visible {
        bottom: 9rem;
    }
}

/* Form Validation States */
.form-control.is-valid {
    border-color: #22C55E;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2322C55E' d='M10.28 2.28L3.989 8.575 1.695 6.28A1 1 0 00.28 7.695l3 3a1 1 0 001.414 0l7-7A1 1 0 0010.28 2.28z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-control.is-invalid {
    border-color: #EF4444;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23EF4444' d='M6 0a6 6 0 100 12A6 6 0 006 0zm0 9a.75.75 0 110-1.5.75.75 0 010 1.5zm.75-3a.75.75 0 01-1.5 0V3.75a.75.75 0 011.5 0V6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.validation-message {
    font-size: 0.8rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.validation-message.error {
    color: #EF4444;
}

.validation-message.success {
    color: #22C55E;
}

/* Focus states for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-soft);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Empty state styling */
.text-center[style*="color: #6b7280"] {
    color: var(--text-secondary) !important;
    padding: 2rem !important;
}

.text-center a {
    color: var(--primary-blue);
    font-weight: 500;
}

/* Table empty state */
td[colspan] {
    text-align: center;
    padding: 2.5rem 1rem !important;
    color: var(--text-secondary);
}

/* Pro tips box - dynamic content */
.usage-examples>div:last-child {
    margin-top: 2rem !important;
    padding: 1.25rem !important;
    background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 100%) !important;
    border: 1px solid var(--primary-soft) !important;
    border-radius: var(--radius-sm) !important;
}

.usage-examples>div:last-child h5 {
    color: var(--primary-blue) !important;
    margin-bottom: 0.75rem !important;
}

.usage-examples>div:last-child ul {
    margin: 0 !important;
    padding-left: 1.5rem !important;
    color: var(--text-primary) !important;
}

.usage-examples>div:last-child li {
    margin-bottom: 0.35rem !important;
    color: var(--text-secondary);
}

/* Result item improvements */
.result-item .result-value {
    background: rgba(34, 197, 94, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
}

/* Warning box in calculator */
.calculator-form .warning-box,
.calculator-results .warning-box {
    margin: 0;
}

/* Button groups in dynamic content */
.action-buttons,
.model-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Quick actions in overview tab */
.tab-pane .quick-actions {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #F8FAFC;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.tab-pane .quick-actions h4 {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Mapping section improvements */
.mapping-section h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.mapping-section>div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Code in tables */
.data-table code,
.models-table code {
    background: #F1F5F9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--primary-blue);
}

/* Node categorization table styling */
.data-table td strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Checkbox improvements */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

/* Better focus ring for checkboxes */
input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--primary-soft);
    outline-offset: 2px;
}

.checkbox-item label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.checkbox-item label small {
    margin-top: 0;
}

/* Re-upload Modal Styles */
.reupload-modal {
    max-width: 520px;
}

.reupload-warning-header {
    background: linear-gradient(135deg, #FEF2F2 0%, #FFF5F5 100%) !important;
    border-bottom-color: #FECACA !important;
}

.reupload-warning-header h3 {
    color: #DC2626 !important;
}

.reupload-warning-header h3 i {
    margin-right: 0.5rem;
}

.reupload-warning {
    background: linear-gradient(135deg, #FEF2F2 0%, #FFFBFB 100%) !important;
    border-color: #FECACA !important;
    margin-bottom: 1.5rem;
}

.reupload-warning h4 {
    color: #DC2626 !important;
}

.reupload-warning p {
    color: #7F1D1D;
    font-size: 0.9rem;
    margin: 0;
}

.current-model-info {
    background: #F8FAFC;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}

.current-model-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.info-value code {
    background: var(--bg-white);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--primary-blue);
    border: 1px solid var(--border-light);
}

.reupload-drop-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-sm);
    padding: 2rem 1.5rem;
    text-align: center;
    background: #FAFBFC;
    transition: all 0.3s ease;
    cursor: pointer;
}

.reupload-drop-zone:hover,
.reupload-drop-zone.dragover {
    border-color: var(--primary-soft);
    background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 100%);
}

.reupload-drop-zone i {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

.reupload-drop-zone p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.reupload-drop-zone .file-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.selected-file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #F0FDF4 0%, #ECFDF5 100%);
    border: 1px solid #22C55E;
    border-radius: var(--radius-sm);
}

.selected-file-info i {
    font-size: 1.5rem;
    color: #16A34A;
}

.selected-file-info span {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.btn-remove-file {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-remove-file:hover {
    background: #FEE2E2;
    color: #DC2626;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem;
    background: #F8FAFC;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.checkbox-container:hover {
    background: #F1F5F9;
}

.checkbox-container input[type="checkbox"] {
    margin-top: 0.15rem;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.checkbox-label strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.checkbox-label small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.btn-danger {
    background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
}

.btn-danger:disabled {
    background: #E5E7EB;
    color: #9CA3AF;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

/* Re-upload badge in model header */
.reupload-badge {
    display: inline-block;
    background: linear-gradient(135deg, #EDE9FE 0%, #F5F3FF 100%);
    color: #7C3AED;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-left: 0.25rem;
}

/* Upload name section */
.upload-name-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.upload-name-section .form-group {
    margin-bottom: 0;
}

.upload-name-section label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    font-size: 0.92rem;
}

.upload-name-section label i {
    color: var(--primary-blue);
    font-size: 0.9rem;
}

.optional-badge {
    font-weight: 500;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.6rem;
    line-height: 1.45;
}

/* Model display name in tables and lists */
.model-display-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.model-filename-secondary {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.model-name-truncate {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Model name section in details header */
.model-name-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.model-name-section h3 {
    margin: 0;
}

.btn-edit-name {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-edit-name:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

.btn-edit-name i {
    font-size: 0.8rem;
}

.model-id-display {
    margin-bottom: 0.5rem;
}

.model-id-display code {
    background: #F1F5F9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--primary-blue);
}

/* Edit name modal */
.edit-name-modal {
    max-width: 480px;
}

.edit-name-modal .info-box {
    margin-top: 1rem;
    padding: 1rem;
    background: #F8FAFC;
    border-radius: 8px;
}

.edit-name-modal .info-box p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.edit-name-modal .info-box code {
    background: #E2E8F0;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* Mobile fixes for dynamic content */
@media (max-width: 768px) {
    .endpoint-header>div:first-child {
        flex-wrap: wrap;
    }

    .endpoint-path {
        word-break: break-all;
    }

    .mapping-section>div:first-child {
        flex-direction: column;
        align-items: stretch;
    }

    .mapping-section>div:first-child>div:last-child {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .usage-examples .code-block pre {
        font-size: 0.75rem;
    }

    .model-name-section {
        flex-wrap: wrap;
    }

    .upload-name-section {
        padding: 1rem;
    }
}

/* Custom Spreadsheet Icon */
.custom-spreadsheet-icon {
    display: inline-block;
    position: relative;
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, #60A5FA, #3B82F6);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.custom-spreadsheet-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(145deg, #2563EB, #1D4ED8);
    border-radius: 4px 4px 0 0;
}

.custom-spreadsheet-icon::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 4px;
    width: 4px;
    height: 4px;
    background: #E0F2FE;
    border-radius: 1px;
    box-shadow: 8px 0 0 #E0F2FE, 16px 0 0 #E0F2FE;
}

.custom-spreadsheet-icon .grid {
    position: absolute;
    top: 12px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: #FFFFFF;
    border-radius: 2px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1px;
    padding: 2px;
}

.custom-spreadsheet-icon .cell {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 1px;
}

.custom-spreadsheet-icon .cell:nth-child(2n) {
    background: #EFF6FF;
}

.custom-spreadsheet-icon .symbol {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    color: #1E40AF;
    font-family: serif;
}

/* Larger version for upload areas */
.custom-spreadsheet-icon.large {
    width: 64px;
    height: 64px;
}

.custom-spreadsheet-icon.large::before {
    height: 12px;
}

.custom-spreadsheet-icon.large::after {
    top: 3px;
    left: 6px;
    width: 6px;
    height: 6px;
    box-shadow: 12px 0 0 #E0F2FE, 24px 0 0 #E0F2FE;
}

.custom-spreadsheet-icon.large .grid {
    top: 18px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    padding: 3px;
    gap: 1.5px;
}

.custom-spreadsheet-icon.large .symbol {
    font-size: 22px;
}

/* Icon adjustments for different contexts */
.empty-state-icon .custom-spreadsheet-icon {
    width: 80px;
    height: 80px;
}

.empty-state-icon .custom-spreadsheet-icon::before {
    height: 16px;
}

.empty-state-icon .custom-spreadsheet-icon::after {
    top: 4px;
    left: 8px;
    width: 8px;
    height: 8px;
    box-shadow: 16px 0 0 #E0F2FE, 32px 0 0 #E0F2FE;
}

.empty-state-icon .custom-spreadsheet-icon .grid {
    top: 24px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 4px;
    gap: 2px;
}

.empty-state-icon .custom-spreadsheet-icon .symbol {
    font-size: 28px;
}

/* Small inline version for info boxes */
.info-box .custom-spreadsheet-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}

.info-box .custom-spreadsheet-icon::before {
    height: 4px;
}

.info-box .custom-spreadsheet-icon::after {
    top: 1px;
    left: 2px;
    width: 2px;
    height: 2px;
    box-shadow: 4px 0 0 #E0F2FE, 8px 0 0 #E0F2FE;
}

.info-box .custom-spreadsheet-icon .grid {
    top: 6px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    padding: 1px;
    gap: 0.5px;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.info-box .custom-spreadsheet-icon .symbol {
    font-size: 8px;
}

/* Animated Clock Component */
.animated-clock {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    position: relative;
    display: inline-block;
    background: linear-gradient(145deg, #FEF3C7, #FFFBEB);
    border: 3px solid #D97706;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effects for the clock container */
.stat-icon:hover .animated-clock {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-color: #B45309;
}

.animated-clock::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 3px;
    background: #D97706;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.stat-icon:hover .animated-clock::before {
    background: #B45309;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Clock hands */
.animated-clock .second-hand {
    position: absolute;
    border-radius: 2px;
    transform-origin: 50% 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    left: 50%;
    width: 1px;
    height: 13px;
    top: calc(50% - 13px);
    margin-left: -0.5px;
    background: linear-gradient(180deg, #DC2626, #B91C1C);
    animation: clockSecond 30s linear infinite;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.4);
}

.stat-icon:hover .animated-clock .second-hand {
    background: linear-gradient(180deg, #B91C1C, #991B1B);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.6);
}

/* Clock hour markers */
.animated-clock .marker {
    position: absolute;
    width: 2px;
    height: 4px;
    background: linear-gradient(180deg, #D97706, #B45309);
    top: 2px;
    left: 50%;
    transform-origin: 50% 13px;
    margin-left: -1px;
    border-radius: 1px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-icon:hover .animated-clock .marker {
    background: linear-gradient(180deg, #B45309, #92400E);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.animated-clock .marker:nth-child(1) {
    transform: rotate(0deg);
}

.animated-clock .marker:nth-child(2) {
    transform: rotate(90deg);
}

.animated-clock .marker:nth-child(3) {
    transform: rotate(180deg);
}

.animated-clock .marker:nth-child(4) {
    transform: rotate(270deg);
}

/* Clock animations */
@keyframes clockSecond {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Responsive sizing for stat-icon context */
.stat-icon .animated-clock {
    width: 28px;
    height: 28px;
    border-width: 2.5px;
}

.stat-icon .animated-clock::before {
    width: 2.5px;
    height: 2.5px;
}

.stat-icon .animated-clock .second-hand {
    width: 1px;
    height: 11px;
    top: calc(50% - 11px);
    margin-left: -0.5px;
}

.stat-icon .animated-clock .marker {
    width: 1.5px;
    height: 3px;
    top: 1.5px;
    transform-origin: 50% 11.25px;
    margin-left: -0.75px;
}

/* Enhanced stat-card hover effect for clock */
.stat-card:hover .animated-clock {
    background: linear-gradient(145deg, #FBBF24, #F59E0B);
}

/* Dark mode styling */
[data-theme="dark"] .animated-clock {
    background: linear-gradient(145deg, rgba(217, 119, 6, 0.25) 0%, rgba(30, 41, 59, 0.8) 100%);
    border-color: #FBBF24;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .stat-icon:hover .animated-clock {
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.4) 0%, rgba(30, 41, 59, 0.9) 100%);
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: #F59E0B;
}

[data-theme="dark"] .animated-clock::before {
    background: #FBBF24;
}

[data-theme="dark"] .stat-icon:hover .animated-clock::before {
    background: #F59E0B;
}

[data-theme="dark"] .animated-clock .second-hand {
    background: linear-gradient(180deg, #F87171, #EF4444);
    box-shadow: 0 1px 3px rgba(248, 113, 113, 0.4);
}

[data-theme="dark"] .stat-icon:hover .animated-clock .second-hand {
    background: linear-gradient(180deg, #EF4444, #DC2626);
    box-shadow: 0 2px 6px rgba(248, 113, 113, 0.6);
}

[data-theme="dark"] .animated-clock .marker {
    background: linear-gradient(180deg, #FBBF24, #F59E0B);
}

[data-theme="dark"] .stat-icon:hover .animated-clock .marker {
    background: linear-gradient(180deg, #F59E0B, #D97706);
}

/* Animated Computer Component */
.animated-computer {
    width: 24px;
    height: 18px;
    position: relative;
    display: inline-block;
}

/* Computer base/stand */
.animated-computer .base {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 16px;
    height: 3px;
    background: linear-gradient(145deg, #6B7280, #4B5563);
    border-radius: 2px;
    transform: translateX(-50%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Computer stand */
.animated-computer .stand {
    position: absolute;
    bottom: 3px;
    left: 50%;
    width: 2px;
    height: 4px;
    background: linear-gradient(180deg, #6B7280, #4B5563);
    border-radius: 1px;
    transform: translateX(-50%);
}

/* Computer monitor */
.animated-computer .monitor {
    position: absolute;
    top: 0;
    left: 50%;
    width: 20px;
    height: 14px;
    background: linear-gradient(145deg, #374151, #1F2937);
    border-radius: 2px;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Computer screen */
.animated-computer .screen {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 10px;
    background: linear-gradient(145deg, #10B981, #059669);
    border-radius: 1px;
    animation: computerBlink 2s ease-in-out infinite;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Screen content - blinking cursor */
.animated-computer .cursor {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1px;
    height: 6px;
    background: #FFFFFF;
    animation: cursorBlink 1s ease-in-out infinite alternate;
}

/* Computer animations */
@keyframes computerBlink {

    0%,
    90% {
        background: linear-gradient(145deg, #10B981, #059669);
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 4px rgba(16, 185, 129, 0.3);
    }

    95%,
    100% {
        background: linear-gradient(145deg, #6B7280, #4B5563);
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
    }
}

@keyframes cursorBlink {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

/* Hover effects for computer */
.stat-icon:hover .animated-computer .monitor {
    background: linear-gradient(145deg, #4B5563, #374151);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.stat-icon:hover .animated-computer .screen {
    animation-duration: 1s;
}

.stat-icon:hover .animated-computer .base {
    background: linear-gradient(145deg, #9CA3AF, #6B7280);
}

/* Dark mode styles for computer */
[data-theme="dark"] .animated-computer .monitor {
    background: linear-gradient(145deg, #4B5563, #374151);
}

[data-theme="dark"] .animated-computer .base,
[data-theme="dark"] .animated-computer .stand {
    background: linear-gradient(145deg, #9CA3AF, #6B7280);
}

[data-theme="dark"] .animated-computer .screen {
    background: linear-gradient(145deg, #34D399, #10B981);
}

[data-theme="dark"] .stat-icon:hover .animated-computer .monitor {
    background: linear-gradient(145deg, #6B7280, #4B5563);
}

[data-theme="dark"] .stat-icon:hover .animated-computer .base,
[data-theme="dark"] .stat-icon:hover .animated-computer .stand {
    background: linear-gradient(145deg, #D1D5DB, #9CA3AF);
}

/* Animated Stock Market Graph Component */
.animated-stock-graph {
    width: 28px;
    height: 24px;
    position: relative;
    display: inline-block;
    background: linear-gradient(145deg, #F0FDF4, #ECFDF5);
    border-radius: 4px;
    padding: 4px 3px 3px 3px;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

/* Graph grid background */
.animated-stock-graph::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(90deg, rgba(34, 197, 94, 0.1) 1px, transparent 1px),
        linear-gradient(180deg, rgba(34, 197, 94, 0.1) 1px, transparent 1px);
    background-size: 4px 3px;
    opacity: 0.6;
}

/* Stock line paths */
.animated-stock-graph .line {
    position: absolute;
    bottom: 3px;
    height: 2px;
    background: linear-gradient(90deg, #22C55E, #16A34A);
    border-radius: 1px;
    transform-origin: left center;
}

.animated-stock-graph .line:nth-child(1) {
    left: 2px;
    width: 6px;
    height: 10px;
    animation: stockLine1 6s ease-in-out infinite;
}

.animated-stock-graph .line:nth-child(2) {
    left: 8px;
    width: 5px;
    height: 7px;
    animation: stockLine2 7s ease-in-out infinite 1s;
}

.animated-stock-graph .line:nth-child(3) {
    left: 13px;
    width: 4px;
    height: 12px;
    animation: stockLine3 5.5s ease-in-out infinite 2s;
}

.animated-stock-graph .line:nth-child(4) {
    left: 17px;
    width: 5px;
    height: 8px;
    animation: stockLine4 6.5s ease-in-out infinite 3s;
}

.animated-stock-graph .line:nth-child(5) {
    left: 22px;
    width: 4px;
    height: 11px;
    animation: stockLine5 5s ease-in-out infinite 1.5s;
}

/* Stock market animations - fluctuating heights */
@keyframes stockLine1 {

    0%,
    100% {
        height: 10px;
        background: linear-gradient(90deg, #22C55E, #16A34A);
    }

    25% {
        height: 6px;
        background: linear-gradient(90deg, #EF4444, #DC2626);
    }

    50% {
        height: 14px;
        background: linear-gradient(90deg, #22C55E, #16A34A);
    }

    75% {
        height: 8px;
        background: linear-gradient(90deg, #F59E0B, #D97706);
    }
}

@keyframes stockLine2 {

    0%,
    100% {
        height: 7px;
        background: linear-gradient(90deg, #F59E0B, #D97706);
    }

    30% {
        height: 12px;
        background: linear-gradient(90deg, #22C55E, #16A34A);
    }

    60% {
        height: 4px;
        background: linear-gradient(90deg, #EF4444, #DC2626);
    }

    80% {
        height: 9px;
        background: linear-gradient(90deg, #22C55E, #16A34A);
    }
}

@keyframes stockLine3 {

    0%,
    100% {
        height: 12px;
        background: linear-gradient(90deg, #22C55E, #16A34A);
    }

    20% {
        height: 8px;
        background: linear-gradient(90deg, #F59E0B, #D97706);
    }

    40% {
        height: 4px;
        background: linear-gradient(90deg, #EF4444, #DC2626);
    }

    70% {
        height: 15px;
        background: linear-gradient(90deg, #22C55E, #16A34A);
    }
}

@keyframes stockLine4 {

    0%,
    100% {
        height: 8px;
        background: linear-gradient(90deg, #F59E0B, #D97706);
    }

    35% {
        height: 5px;
        background: linear-gradient(90deg, #EF4444, #DC2626);
    }

    65% {
        height: 11px;
        background: linear-gradient(90deg, #22C55E, #16A34A);
    }

    85% {
        height: 6px;
        background: linear-gradient(90deg, #F59E0B, #D97706);
    }
}

@keyframes stockLine5 {

    0%,
    100% {
        height: 11px;
        background: linear-gradient(90deg, #22C55E, #16A34A);
    }

    15% {
        height: 14px;
        background: linear-gradient(90deg, #22C55E, #16A34A);
    }

    45% {
        height: 7px;
        background: linear-gradient(90deg, #EF4444, #DC2626);
    }

    75% {
        height: 10px;
        background: linear-gradient(90deg, #F59E0B, #D97706);
    }
}

/* Hover effects for stock graph */
.stat-icon:hover .animated-stock-graph {
    background: linear-gradient(145deg, #DCFCE7, #F0FDF4);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.stat-icon:hover .animated-stock-graph .line {
    animation-duration: 4s !important;
}

.stat-icon:hover .animated-stock-graph::before {
    opacity: 0.8;
}

/* Dark mode styles for stock graph */
[data-theme="dark"] .animated-stock-graph {
    background: linear-gradient(145deg, rgba(34, 197, 94, 0.15), rgba(30, 41, 59, 0.8));
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .animated-stock-graph::before {
    background-image:
        linear-gradient(90deg, rgba(34, 197, 94, 0.2) 1px, transparent 1px),
        linear-gradient(180deg, rgba(34, 197, 94, 0.2) 1px, transparent 1px);
}

[data-theme="dark"] .stat-icon:hover .animated-stock-graph {
    background: linear-gradient(145deg, rgba(34, 197, 94, 0.25), rgba(30, 41, 59, 0.9));
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ============================================
   Folder Sidebar & Organization Styles
   ============================================ */

.models-layout {
    display: flex;
    gap: 1.5rem;
}

.folder-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 1rem;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.folder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.folder-header h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.folder-header h4 i {
    color: var(--primary-blue);
}

.btn-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--primary-blue);
    color: white;
}

.folder-tree {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.folder-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
    text-align: left;
}

.folder-item:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.folder-item.active {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.1) 0%, rgba(59, 130, 246, 0.08) 100%);
    color: var(--primary-blue);
    font-weight: 600;
}

.folder-item i {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.folder-item .tree-label,
.folder-item>span:not(.tree-toggle-spacer):not(.tree-toggle):not(.folder-count):not(.tree-line):not(.tree-line-spacer) {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-count {
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.folder-item.active .folder-count {
    background: rgba(30, 64, 175, 0.15);
    color: var(--primary-blue);
}

/* Tree View Styles - VS Code-like */
.tree-node {
    position: relative;
}

.tree-children {
    margin-left: 0;
    padding-left: 16px;
    position: relative;
}

/* Vertical guide line (VS Code style) */
.tree-children::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-light);
    opacity: 0.5;
}

.tree-node.last>.tree-children::before {
    display: none;
}

/* Tree item row */
.tree-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding: 2px 8px;
    padding-left: 4px;
    margin: 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    line-height: 22px;
    color: var(--text-primary);
    transition: background var(--transition-fast);
    position: relative;
    text-align: left;
}

.tree-item:hover {
    background: rgba(90, 93, 94, 0.12);
}

/* Horizontal line to item */
.tree-line {
    position: absolute;
    left: -0.75rem;
    width: 0.5rem;
    height: 1px;
    background: var(--border-light);
}

.tree-line-spacer {
    width: 0;
}

.tree-toggle {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    cursor: pointer;
    flex-shrink: 0;
}

.tree-toggle:hover {
    color: var(--primary-blue);
}

.tree-toggle-spacer {
    width: 16px;
    flex-shrink: 0;
}

.tree-item.expanded .tree-toggle {
    transform: rotate(90deg);
}

.tree-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Model item in tree */
.model-item {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.model-item i {
    color: var(--success-color);
}

.model-item:hover {
    color: var(--primary-blue);
}

.model-item:hover i {
    color: var(--primary-blue);
}

/* Dark mode tree styles */
[data-theme="dark"] .tree-children::before,
[data-theme="dark"] .tree-line {
    background: var(--border-medium);
}

.models-content {
    flex: 1;
    min-width: 0;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
    width: 100%;
    max-width: 440px;
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3 i {
    color: var(--primary-blue);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Dark mode folder styles */
[data-theme="dark"] .folder-sidebar {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .folder-header {
    border-bottom-color: var(--border-medium);
}

[data-theme="dark"] .folder-item:hover {
    background: var(--bg-subtle);
}

[data-theme="dark"] .folder-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(30, 41, 59, 0.8) 100%);
}

[data-theme="dark"] .folder-count {
    background: var(--bg-subtle);
}

[data-theme="dark"] .folder-children {
    border-left-color: var(--border-medium);
}

[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .modal-content {
    background: var(--bg-elevated);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border-medium);
}

/* Responsive folder sidebar */
@media (max-width: 1024px) {
    .models-layout {
        flex-direction: column;
    }

    .folder-sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }

    .folder-tree {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .folder-item {
        display: inline-flex;
    }

    .folder-children {
        display: none;
    }
}

/* Folder Dropdown in Table */
.folder-dropdown {
    position: relative;
    display: inline-block;
}

.folder-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    min-width: 80px;
    transition: all var(--transition-fast);
}

.folder-select:hover {
    border-color: var(--primary-blue);
    background: var(--bg-white);
}

.folder-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

[data-theme="dark"] .folder-select {
    background: var(--bg-subtle);
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

[data-theme="dark"] .folder-select:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-light);
}

/* Version Styles */
.version-info-section {
    margin-top: 0.5rem;
}

.version-dropdown {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-medium);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.version-dropdown:hover {
    border-color: var(--primary-light);
}

.version-dropdown:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.version-badge {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-light) 100%);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.25);
}

[data-theme="dark"] .version-dropdown {
    background: var(--bg-subtle);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

[data-theme="dark"] .version-dropdown:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-light);
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination-info span {
    font-weight: 600;
    color: var(--text-primary);
}

.pagination-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.pagination-size-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.pagination-size-selector select {
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-medium);
    background: var(--bg-white);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.pagination-size-selector select:hover {
    border-color: var(--primary-blue);
}

.pagination-size-selector select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not([disabled]) {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.pagination-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn i {
    font-size: 0.75rem;
}

[data-theme="dark"] .pagination-controls {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .pagination-btn {
    background: var(--bg-subtle);
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

[data-theme="dark"] .pagination-btn:hover:not([disabled]) {
    background: var(--primary-blue);
    color: white;
}

[data-theme="dark"] .pagination-size-selector select {
    background: var(--bg-subtle);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

/* Folder Actions Dropdown */
.folder-actions-dropdown {
    position: relative;
    display: inline-flex;
    margin-left: auto;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.tree-item.folder-item:hover .folder-actions-dropdown {
    opacity: 1;
}

.folder-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: var(--primary-blue);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all var(--transition-fast);
}

.folder-action-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.folder-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    min-width: 160px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.folder-menu.show {
    display: block;
    animation: fadeIn 0.15s ease;
}

.folder-menu-item {
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.folder-menu-item:hover {
    background: var(--bg-subtle);
}

.folder-menu-item i {
    width: 16px;
    color: var(--primary-blue);
}

[data-theme="dark"] .folder-menu {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .folder-menu-item:hover {
    background: var(--bg-subtle);
}

/* Folder Menu Divider */
.folder-menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0.25rem 0;
}

[data-theme="dark"] .folder-menu-divider {
    background: var(--border-medium);
}

/* Folder Menu Danger Item */
.folder-menu-item-danger {
    color: #DC2626 !important;
}

.folder-menu-item-danger:hover {
    background: rgba(220, 38, 38, 0.1) !important;
}

.folder-menu-item-danger i {
    color: #DC2626 !important;
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(145deg, #DC2626 0%, #B91C1C 100%);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(145deg, #B91C1C 0%, #991B1B 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-danger:active {
    transform: translateY(0);
}

/* ============================================================================
   Upload Modal Styles
   ============================================================================ */

/* Large modal variant */
.modal-lg {
    max-width: 560px;
}

/* Folder path display (read-only) */
.folder-path-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-gray);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 500;
}

.folder-path-display i {
    color: var(--primary-blue);
}

[data-theme="dark"] .folder-path-display {
    background: var(--bg-subtle);
    border-color: var(--border-medium);
}

/* Upload zone in modal */
.upload-zone-modal {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-subtle);
}

.upload-zone-modal:hover,
.upload-zone-modal.dragover {
    border-color: var(--primary-blue);
    background: rgba(59, 130, 246, 0.05);
}

.upload-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-zone-icon {
    font-size: 2.5rem;
    color: var(--primary-blue);
    opacity: 0.8;
}

.upload-zone-modal h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.upload-zone-modal p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.upload-zone-modal .file-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 0.75rem;
}

.upload-zone-modal .file-info span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Selected file info display */
.selected-file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-sm);
}

.selected-file-info i.fa-file-excel {
    font-size: 1.5rem;
    color: #16A34A;
}

.selected-file-info span {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.selected-file-info .btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(220, 38, 38, 0.1);
    border: none;
    color: #DC2626;
}

.selected-file-info .btn-icon:hover {
    background: rgba(220, 38, 38, 0.2);
}

[data-theme="dark"] .upload-zone-modal {
    background: var(--bg-subtle);
    border-color: var(--border-medium);
}

[data-theme="dark"] .upload-zone-modal:hover,
[data-theme="dark"] .upload-zone-modal.dragover {
    border-color: var(--primary-light);
    background: rgba(59, 130, 246, 0.1);
}

/* Form Error Message */
.form-error {
    display: block;
    color: #DC2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Required Badge */
.required-badge {
    color: #DC2626;
    font-weight: 600;
}


/* ============================================================================
   Analytics Page Styles
   ============================================================================ */

/* Clickable stat cards */
.stat-card-clickable {
    cursor: pointer;
    position: relative;
}

.stat-card-clickable:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.stat-card-clickable:active {
    transform: translateY(-2px);
}

.stat-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-top: 0.5rem;
    opacity: 0.8;
    transition: all var(--transition-fast);
}

.stat-card-clickable:hover .stat-link {
    opacity: 1;
    transform: translateX(2px);
}

.stat-link i {
    font-size: 0.65rem;
}

/* Analytics Container */
.analytics-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Analytics Stats Row */
.analytics-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.analytics-stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
}

.analytics-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.analytics-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: linear-gradient(145deg, rgba(30, 64, 175, 0.1) 0%, rgba(59, 130, 246, 0.15) 100%);
    color: var(--primary-blue);
}

.analytics-stat-card:nth-child(1) .analytics-stat-icon {
    background: linear-gradient(145deg, rgba(30, 64, 175, 0.1) 0%, rgba(59, 130, 246, 0.15) 100%);
    color: var(--primary-blue);
}

.analytics-stat-card:nth-child(2) .analytics-stat-icon {
    background: linear-gradient(145deg, rgba(13, 148, 136, 0.1) 0%, rgba(20, 184, 166, 0.15) 100%);
    color: var(--accent-teal);
}

.analytics-stat-card:nth-child(3) .analytics-stat-icon {
    background: linear-gradient(145deg, rgba(234, 88, 12, 0.1) 0%, rgba(251, 146, 60, 0.15) 100%);
    color: #EA580C;
}

.analytics-stat-card:nth-child(4) .analytics-stat-icon {
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.1) 0%, rgba(167, 139, 250, 0.15) 100%);
    color: #7C3AED;
}

.analytics-stat-content h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.analytics-stat-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Analytics Chart Section */
.analytics-chart-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.analytics-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.analytics-chart-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analytics-chart-header h3 i {
    color: var(--primary-blue);
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-controls .form-control {
    min-width: 160px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-icon i {
    margin: 0;
}

/* Chart Container */
.analytics-chart-container {
    position: relative;
    height: 350px;
    width: 100%;
    margin-bottom: 1rem;
}

.analytics-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Chart Legend */
.chart-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.gradient {
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
}

/* Dark mode for analytics */
[data-theme="dark"] .analytics-stat-card {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .analytics-stat-card:nth-child(1) .analytics-stat-icon {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.2) 0%, rgba(30, 41, 59, 0.8) 100%);
}

[data-theme="dark"] .analytics-stat-card:nth-child(2) .analytics-stat-icon {
    background: linear-gradient(145deg, rgba(20, 184, 166, 0.2) 0%, rgba(30, 41, 59, 0.8) 100%);
}

[data-theme="dark"] .analytics-stat-card:nth-child(3) .analytics-stat-icon {
    background: linear-gradient(145deg, rgba(251, 146, 60, 0.2) 0%, rgba(30, 41, 59, 0.8) 100%);
}

[data-theme="dark"] .analytics-stat-card:nth-child(4) .analytics-stat-icon {
    background: linear-gradient(145deg, rgba(167, 139, 250, 0.2) 0%, rgba(30, 41, 59, 0.8) 100%);
}

[data-theme="dark"] .analytics-chart-section {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .chart-legend {
    border-top-color: var(--border-medium);
}

/* APM Traces Section */
.analytics-traces-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    margin-top: 1.5rem;
}

.analytics-traces-section .analytics-chart-header {
    margin-bottom: 1rem;
}

.analytics-traces-section .badge {
    background: var(--primary-gradient);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.analytics-traces-section .table-container {
    max-height: 400px;
    overflow-y: auto;
}

.analytics-traces-section .data-table {
    width: 100%;
    border-collapse: collapse;
}

.analytics-traces-section .data-table th {
    background: var(--bg-gray);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.analytics-traces-section .data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

.analytics-traces-section .data-table tr:hover td {
    background: var(--bg-gray);
}

.analytics-traces-section .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.analytics-traces-section .status-badge.success {
    background: rgba(34, 197, 94, 0.15);
    color: #16A34A;
}

.analytics-traces-section .status-badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: #DC2626;
}

.analytics-traces-section .model-id-cell {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--primary-blue);
}

.analytics-traces-section .timestamp-cell {
    white-space: nowrap;
}

.analytics-traces-section .duration-cell {
    font-weight: 600;
}

.analytics-traces-section .duration-cell.fast {
    color: #16A34A;
}

.analytics-traces-section .duration-cell.medium {
    color: #F59E0B;
}

.analytics-traces-section .duration-cell.slow {
    color: #DC2626;
}

[data-theme="dark"] .analytics-traces-section {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .analytics-traces-section .data-table th {
    background: var(--bg-gray);
}

[data-theme="dark"] .analytics-traces-section .data-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Responsive */
@media (max-width: 992px) {
    .analytics-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .analytics-stats-row {
        grid-template-columns: 1fr;
    }

    .analytics-chart-container {
        height: 280px;
    }

    .analytics-chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-controls {
        width: 100%;
    }

    .chart-controls .form-control {
        flex: 1;
    }
}

/* ============================================================================
   Model Detail Page Styles (US2.2.1 - US2.2.24)
   ============================================================================ */

/* Model Detail Header */
.model-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.model-detail-header .header-left {
    flex-shrink: 0;
}

.model-detail-header .header-center {
    flex: 1;
    min-width: 200px;
}

.model-detail-header .header-right {
    flex-shrink: 0;
}

.model-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.model-title-row h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.model-title-row h2.editable {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.model-title-row h2.editable:hover {
    background: var(--bg-subtle);
}

.folder-breadcrumb {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.folder-breadcrumb i {
    margin-right: 0.5rem;
    color: var(--accent-amber);
}

/* Version Selector - Modern Custom Dropdown */
.version-selector-modern {
    position: relative;
}

.version-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    font-family: inherit;
}

.version-trigger:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, rgba(139, 92, 246, 0.04) 100%);
}

.version-trigger .fa-code-branch {
    color: var(--primary-blue);
    font-size: 0.82rem;
}

.version-trigger-text {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
}

.version-trigger-label {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.version-active-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
    animation: version-pulse 2s ease-in-out infinite;
}

@keyframes version-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
    }
}

.version-chevron {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 0.15rem;
}

.version-selector-modern.open .version-chevron {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.version-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.version-selector-modern.open .version-dropdown-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.version-dropdown-header {
    padding: 0.65rem 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.version-dropdown-header i {
    color: var(--primary-light);
}

.version-pills-list {
    padding: 0.5rem;
    max-height: 240px;
    overflow-y: auto;
}

/* Version Pill */
.version-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    margin-bottom: 2px;
}

.version-pill:hover {
    background: var(--bg-subtle);
}

.version-pill.selected {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-color: rgba(59, 130, 246, 0.2);
}

.version-pill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    font-family: var(--font-mono);
}

.version-pill.selected .version-pill-badge {
    background: var(--primary-gradient);
    color: #1e293b;
}

.version-pill-info {
    flex: 1;
    min-width: 0;
}

.version-pill-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.version-pill-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.version-pill-active-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #16a34a;
    background: rgba(34, 197, 94, 0.12);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.version-pill .version-pill-check {
    color: var(--primary-blue);
    font-size: 0.8rem;
    flex-shrink: 0;
    opacity: 0;
}

.version-pill.selected .version-pill-check {
    opacity: 1;
}

/* Dark mode */
[data-theme="dark"] .version-trigger {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .version-trigger:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: var(--primary-light);
}

[data-theme="dark"] .version-dropdown-panel {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .version-dropdown-header {
    background: rgba(0, 0, 0, 0.15);
    border-bottom-color: var(--border-medium);
}

[data-theme="dark"] .version-pill:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .version-pill.selected {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .version-pill-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-draft {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
}

.status-badge.status-active {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    color: #065F46;
}

.status-badge.status-inactive {
    background: linear-gradient(135deg, #F3F4F6, #E5E7EB);
    color: #4B5563;
}

.status-badge.latest-active {
    position: relative;
}

.status-badge.latest-active::after {
    content: '★';
    margin-left: 0.35rem;
    font-size: 0.7rem;
}

/* Model Summary Panel */
.model-summary-panel {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.summary-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.summary-item span,
.summary-item code {
    font-size: 0.95rem;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: break-word;
}

.summary-item code {
    font-family: var(--font-mono);
    background: var(--bg-subtle);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Fix for long filenames in Original File field */
#model-detail-filename {
    word-break: break-all;
    display: block;
    max-width: 100%;
}

.copy-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Action Bar */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.action-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-bar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.completion-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.completion-status.complete {
    color: #059669;
}

.completion-status.complete i {
    color: #10B981;
}

.completion-status.incomplete {
    color: #DC2626;
}

.completion-status.incomplete i {
    color: #EF4444;
}

/* Error Banner */
.error-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    color: #991B1B;
}

.error-banner i {
    color: #DC2626;
    font-size: 1.1rem;
}

/* Model Detail Tabs */
.model-detail-tabs {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.model-detail-tabs .tab-buttons {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-subtle);
}

.model-detail-tabs .tab-button {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.model-detail-tabs .tab-button:hover {
    background: var(--bg-white);
    color: var(--text-primary);
}

.model-detail-tabs .tab-button.active {
    background: var(--bg-white);
    color: var(--primary-blue);
    border-bottom: 2px solid var(--primary-blue);
    margin-bottom: -1px;
}

.tab-count {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.model-detail-tabs .tab-button.active .tab-count {
    background: var(--primary-light);
    color: white;
}

/* I/O Table */
.io-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.io-table-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

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

.io-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-light);
}

.io-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.io-table tr:last-child td {
    border-bottom: none;
}

.io-table tr:hover td {
    background: var(--bg-subtle);
}

.io-table tr.incomplete td {
    background: #FEF3C7;
}

.io-table tr.incomplete:hover td {
    background: #FDE68A;
}

/* Inline Editable Fields */
.inline-edit {
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition-fast);
    display: inline-block;
    min-width: 100px;
}

.inline-edit:hover {
    background: var(--bg-subtle);
}

.inline-edit.editing {
    padding: 0;
}

.inline-edit input,
.inline-edit select {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--primary-light);
    border-radius: 4px;
    font-size: inherit;
    outline: none;
}

/* Data Type Dropdown */
.data-type-select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
}

.data-type-select:focus {
    border-color: var(--primary-light);
    outline: none;
}

/* Status Indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-indicator.complete {
    color: #059669;
}

.status-indicator.incomplete {
    color: #DC2626;
}

.status-indicator i {
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* Action Buttons in Table */
.io-table .action-buttons {
    display: flex;
    gap: 0.5rem;
}

.io-table .btn-icon {
    padding: 0.35rem;
    border-radius: 4px;
}

/* Dark Mode Overrides */
[data-theme="dark"] .model-summary-panel,
[data-theme="dark"] .action-bar,
[data-theme="dark"] .model-detail-tabs {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .status-badge.status-draft {
    background: linear-gradient(135deg, #78350F, #92400E);
    color: #FEF3C7;
}

[data-theme="dark"] .status-badge.status-active {
    background: linear-gradient(135deg, #065F46, #047857);
    color: #D1FAE5;
}

[data-theme="dark"] .status-badge.status-inactive {
    background: linear-gradient(135deg, #374151, #4B5563);
    color: #E5E7EB;
}

[data-theme="dark"] .error-banner {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
    color: #FCA5A5;
}

[data-theme="dark"] .io-table th {
    background: var(--bg-subtle);
}

[data-theme="dark"] .io-table tr.incomplete td {
    background: rgba(245, 158, 11, 0.1);
}

[data-theme="dark"] .io-table tr.incomplete:hover td {
    background: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .model-detail-tabs .tab-buttons {
    background: var(--bg-subtle);
}

[data-theme="dark"] .model-detail-tabs .tab-button.active {
    background: var(--bg-elevated);
}

/* ============================================================================
   Upload New Version Modal (US2.3.x)
   ============================================================================ */

.version-modal-info {
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.version-modal-info .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.version-modal-info .info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.version-modal-info .info-item label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.version-modal-info .info-item span,
.version-modal-info .info-item code {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.version-modal-info .info-item code {
    font-family: var(--font-mono);
    background: var(--bg-white);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.processing-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    margin-top: 1rem;
}

.processing-state i {
    font-size: 1.25rem;
    color: var(--primary-blue);
}

/* Dark mode for version modal */
[data-theme="dark"] .version-modal-info {
    background: var(--bg-subtle);
    border-color: var(--border-medium);
}

[data-theme="dark"] .version-modal-info .info-item code {
    background: var(--bg-elevated);
}

[data-theme="dark"] .processing-state {
    background: var(--bg-subtle);
}

/* ============================================================================
   API Key Management Styles — COMMENTED OUT
   ============================================================================

.api-keys-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.api-key-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.api-key-card:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.1);
}

.api-key-card.inactive {
    opacity: 0.6;
    background: var(--bg-subtle);
}

.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.api-key-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.api-key-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.api-key-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.api-key-badges .version-badge {
    background: var(--primary-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.api-key-badges .status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.api-key-badges .status-badge.active {
    background: var(--success-bg);
    color: var(--success-color);
}

.api-key-badges .status-badge.inactive {
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.api-key-actions {
    display: flex;
    gap: 0.5rem;
}

.api-key-value {
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.api-key-value code {
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-all;
}

.api-key-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.api-key-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.api-key-meta i {
    font-size: 0.75rem;
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.api-key-display code {
    flex: 1;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-all;
}

[data-theme="dark"] .api-key-card {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .api-key-card:hover {
    border-color: var(--primary-blue);
}

[data-theme="dark"] .api-key-card.inactive {
    background: var(--bg-base);
}

[data-theme="dark"] .api-key-value {
    background: var(--bg-base);
    border-color: var(--border-medium);
}

[data-theme="dark"] .api-key-display {
    background: var(--bg-base);
    border-color: var(--border-medium);
}


/* ============================================================================
   Recent Inputs Dropdown (Calculator History)
   ============================================================================ */

.recent-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    min-width: 320px;
    max-width: 420px;
    max-height: 350px;
    overflow-y: auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border-light);
    z-index: 100;
    animation: dropdownSlideUp 0.15s ease;
}

@keyframes dropdownSlideUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recent-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.recent-dropdown-header i {
    color: var(--primary-blue);
    margin-right: 0.4rem;
}

.recent-dropdown-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 0.25rem;
    line-height: 1;
}

.recent-dropdown-close:hover {
    color: var(--text-primary);
}

.recent-dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.12s ease;
    gap: 0.75rem;
}

.recent-dropdown-item:last-child {
    border-bottom: none;
}

.recent-dropdown-item:hover {
    background: rgba(30, 64, 175, 0.04);
}

.recent-dropdown-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.recent-dropdown-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.recent-dropdown-summary {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-dropdown-use {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary-blue);
    white-space: nowrap;
    flex-shrink: 0;
}

.recent-dropdown-item:hover .recent-dropdown-use {
    text-decoration: underline;
}

/* ============================================================================
   History Detail Popup
   ============================================================================ */

.history-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: historyOverlayIn 0.15s ease;
}

@keyframes historyOverlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.history-popup-modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    max-width: 560px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: historyModalIn 0.2s ease;
}

@keyframes historyModalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.history-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.history-popup-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-popup-header h4 i {
    color: var(--primary-blue);
}

.history-popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 0.25rem;
    line-height: 1;
}

.history-popup-close:hover {
    color: var(--text-primary);
}

.history-popup-meta {
    padding: 0.6rem 1.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-light);
}

.history-popup-meta i {
    margin-right: 0.25rem;
    font-size: 0.72rem;
}

.history-popup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
}

.history-popup-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
}

.history-popup-field:nth-child(2n) {
    border-right: none;
}

.history-popup-field:nth-last-child(-n+2) {
    border-bottom: none;
}

.history-popup-key {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.history-popup-val {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
    word-break: break-word;
}

.history-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-light);
}