/* ============================================
   Bharathi Bank – Loan Approval Prediction
   Premium Dark Theme Design System
   ============================================ */

/* ─── CSS Custom Properties ─── */
:root {
    /* Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.8);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-glow: rgba(99, 102, 241, 0.3);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --success-border: rgba(16, 185, 129, 0.3);

    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --warning-border: rgba(245, 158, 11, 0.3);

    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-border: rgba(239, 68, 68, 0.3);

    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.15);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    --gradient-bg: linear-gradient(135deg, #0a0e1a 0%, #1a1040 50%, #0a0e1a 100%);
    --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.04));

    /* Glass */
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(99, 102, 241, 0.15);
    --glass-blur: 20px;

    /* Spacing */
    --nav-height: 72px;
    --container-max: 1280px;
    --section-gap: 4rem;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Animated Background ─── */
.bg-gradient {
    position: fixed;
    inset: 0;
    background: var(--gradient-bg);
    z-index: -2;
}

.bg-particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.bg-particles::before,
.bg-particles::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: floatOrb 20s ease-in-out infinite;
}

.bg-particles::before {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    top: 10%;
    left: 10%;
}

.bg-particles::after {
    width: 350px;
    height: 350px;
    background: var(--accent-secondary);
    bottom: 10%;
    right: 10%;
    animation-delay: -10s;
    animation-direction: reverse;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, 60px) scale(0.95); }
    75% { transform: translate(40px, 20px) scale(1.05); }
}

/* ─── Glass Card ─── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-glow);
}

/* ─── Navbar ─── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: var(--container-max);
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.brand-icon svg {
    width: 22px;
    height: 22px;
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link svg {
    width: 18px;
    height: 18px;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-link.active {
    color: var(--accent-primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    z-index: 999;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s;
}

.mobile-nav-link:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

/* ─── Main Content ─── */
.main-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: calc(var(--nav-height) + 2rem) 2rem 2rem;
}

/* ─── Hero ─── */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    min-height: 420px;
    margin-bottom: var(--section-gap);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: var(--info-bg);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--info);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 480px;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-visual {
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.hero-card {
    padding: 2rem;
    max-width: 320px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.hero-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.hero-card-icon.approved {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.hero-card-icon svg {
    width: 28px;
    height: 28px;
}

.hero-card-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.hero-card-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-card-value.approved { color: var(--success); }
.hero-card-value.rejected { color: var(--danger); }

.hero-card-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.2);
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

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

.btn-loader {
    display: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ─── Section Titles ─── */
.section-title, .page-title {
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.section-footer {
    text-align: center;
    margin-top: 1.5rem;
}

/* ─── Stats Grid ─── */
.stats-section {
    margin-bottom: var(--section-gap);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.stat-card {
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease calc(var(--delay, 0s)) both;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.total {
    background: var(--info-bg);
    color: var(--info);
}

.stat-icon.approved {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon.confidence {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
}

.stat-icon.rejected {
    background: var(--danger-bg);
    color: var(--danger);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ─── Risk Distribution ─── */
.risk-section {
    margin-bottom: var(--section-gap);
}

.risk-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.risk-card {
    padding: 1.5rem;
}

.risk-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.risk-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.risk-dot.low { background: var(--success); }
.risk-dot.medium { background: var(--warning); }
.risk-dot.high { background: var(--danger); }

.risk-card-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.risk-card.low .risk-card-value { color: var(--success); }
.risk-card.medium .risk-card-value { color: var(--warning); }
.risk-card.high .risk-card-value { color: var(--danger); }

.risk-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.risk-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.risk-bar-fill.low { background: var(--success); }
.risk-bar-fill.medium { background: var(--warning); }
.risk-bar-fill.high { background: var(--danger); }

/* ─── Risk & Status Badges ─── */
.risk-badge, .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.risk-badge.low {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.risk-badge.medium {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.risk-badge.high {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.status-badge.approved {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.status-badge.rejected {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

/* ─── Data Tables ─── */
.table-container {
    padding: 0;
    overflow-x: auto;
}

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

.data-table thead {
    background: rgba(99, 102, 241, 0.08);
}

.data-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

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

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

.model-cell {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

/* ─── Prediction Form ─── */
.predict-section {
    margin-bottom: var(--section-gap);
}

.predict-header {
    margin-bottom: 2rem;
}

.predict-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.form-card {
    padding: 2rem;
}

.form-header {
    margin-bottom: 1.5rem;
}

.form-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group label svg {
    color: var(--accent-primary);
}

.form-group input[type="number"],
.form-group select {
    padding: 0.7rem 0.85rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.2s;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Credit Score Slider */
input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--danger), var(--warning), var(--success));
    border-radius: 3px;
    outline: none;
    margin-top: 0.5rem;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--accent-primary);
    cursor: pointer;
}

.slider-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

#creditScoreDisplay {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    transition: color 0.3s;
}

.score-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

/* ─── Result Panel ─── */
.result-panel {
    position: sticky;
    top: calc(var(--nav-height) + 2rem);
}

.result-card {
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.result-card.approved::before { background: var(--success); }
.result-card.rejected::before { background: var(--danger); }
.result-card.error::before { background: var(--danger); }

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-icon.approved {
    background: var(--success-bg);
    color: var(--success);
    border: 2px solid var(--success-border);
}

.result-icon.rejected, .result-icon.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 2px solid var(--danger-border);
}

.result-icon svg {
    width: 28px;
    height: 28px;
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.result-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
}

.result-value.approved { color: var(--success); }
.result-value.rejected { color: var(--danger); }

.result-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.result-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

.confidence-bar {
    flex: 1;
    max-width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 1s ease;
}

.confidence-value {
    position: absolute;
    right: -45px;
    top: -4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    width: 40px;
    text-align: left;
}

.result-summary h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ─── Comparison Table ─── */
.comparison-card {
    padding: 1.5rem;
}

.comparison-card h3 {
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* ─── History ─── */
.history-section {
    margin-bottom: var(--section-gap);
}

.history-header {
    margin-bottom: 2rem;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 0.25rem;
}

.filter-btn {
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.filter-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.table-footer {
    padding: 1rem;
    text-align: center;
}

.table-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── Empty State ─── */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-icon {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ─── Alert ─── */
.alert-section {
    margin-bottom: var(--section-gap);
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.alert.warning {
    border-color: var(--warning-border);
    background: rgba(245, 158, 11, 0.08);
}

.alert.warning svg {
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 2px;
}

.alert strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--warning);
}

.alert p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.alert code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--accent-primary);
}

/* ─── Footer ─── */
.footer {
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    padding: 3rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: var(--container-max);
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.footer-brand svg {
    color: var(--accent-primary);
}

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

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

/* ─── Animations ─── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideUp {
    animation: fadeInUp 0.5s ease both;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 2rem;
        min-height: auto;
    }

    .hero-visual {
        display: none;
    }

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

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

    .result-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .page-title {
        font-size: 1.6rem;
    }

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

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

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

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

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

    .hero-title {
        font-size: 1.8rem;
    }
}
