/* BalanceAnalyzer AI - CSS Design System */

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #131b2e;
    --bg-card: rgba(20, 29, 47, 0.65);
    --bg-glass: rgba(15, 23, 42, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(59, 130, 246, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #06b6d4;
    
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.8);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 40%);
}

.hidden {
    display: none !important;
}

/* Header Styles */
.app-header {
    background-color: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.logo-icon {
    font-size: 2.2rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.3));
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-ai {
    background: var(--accent-gradient);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
    -webkit-text-fill-color: initial;
    font-weight: 800;
    letter-spacing: 0.5px;
}

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

.header-settings {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.api-key-container {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.icon-key {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

#gemini-key {
    background-color: rgba(11, 15, 25, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.5rem 0.8rem 0.5rem 2rem;
    font-size: 0.85rem;
    width: 250px;
    transition: var(--transition);
}

#gemini-key:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.checkbox-container input {
    accent-color: var(--color-primary);
    cursor: pointer;
}

.api-status-badge {
    background-color: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.9rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active {
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.status-dot.warning {
    background-color: var(--color-warning);
    box-shadow: 0 0 8px var(--color-warning);
}

/* App Container Layout */
.app-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem;
    flex-grow: 1;
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2.5rem;
}

@media (max-width: 1100px) {
    .app-container {
        grid-template-columns: 1fr;
    }
}

/* Section Cards */
.section-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
}

.section-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(15, 23, 42, 0.3);
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.card-body {
    padding: 1.5rem;
}

.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

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

/* Drop Zone Styles */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    background-color: rgba(15, 23, 42, 0.2);
    transition: var(--transition);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--color-primary);
    background-color: rgba(59, 130, 246, 0.05);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.drop-zone:hover .upload-icon {
    color: var(--color-primary);
    transform: translateY(-4px);
}

.upload-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

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

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

/* File Loaded Banner */
.file-loaded-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    margin-top: 0.5rem;
    animation: slideIn 0.3s ease;
}

.file-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-left: 0.8rem;
    overflow: hidden;
}

.file-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.btn-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

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

/* Mini Drop Zones */
.document-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.doc-upload-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.drop-zone.mini {
    padding: 1.2rem;
    flex-direction: row;
    justify-content: center;
    gap: 0.8rem;
    border-radius: var(--radius-sm);
}

.upload-icon-mini {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.drop-zone.mini:hover .upload-icon-mini {
    color: var(--color-primary);
}

.upload-text-mini {
    font-size: 0.85rem;
}

.upload-hint-mini {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.file-loaded-banner.mini {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    margin-top: 0;
}

.file-name-mini {
    flex-grow: 1;
    margin-left: 0.6rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-weight: 500;
}

.btn-remove-mini {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
}

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

/* Action Trigger Button */
.btn-primary-large {
    width: 100%;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    padding: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: var(--transition);
}

.btn-primary-large:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
}

.btn-primary-large:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary-large:disabled {
    background: #1e293b;
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    border: 1px solid var(--border-color);
}

/* Dashboard Section */
.dashboard-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    min-height: 550px;
    position: relative;
    overflow: hidden;
}

/* Dashboard Empty State */
.dashboard-empty {
    margin: auto;
    text-align: center;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 480px;
}

.empty-animation-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-muted);
    z-index: 2;
}

.orbiting-circle {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px dashed rgba(59, 130, 246, 0.25);
    border-radius: 50%;
    animation: rotate 15s linear infinite;
}

.dashboard-empty h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dashboard-empty p {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Dashboard Loading State */
.dashboard-loading {
    margin: auto;
    text-align: center;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 480px;
    width: 100%;
}

.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.brain-pulsing {
    font-size: 2rem;
    color: var(--color-primary);
    animation: pulse 1.8s ease-in-out infinite;
}

.dashboard-loading h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dashboard-loading p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.progress-bar-container {
    width: 80%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.progress-percent {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* Dashboard Main Content */
.dashboard-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.summary-action-banner {
    padding: 1.8rem 2.2rem;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(15, 23, 42, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .summary-action-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

.company-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    background-color: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 1.4rem;
}

.profile-details h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
}

.profile-details p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.compliance-badge-large {
    background-color: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.compliance-badge-large.warning {
    background-color: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
}

.compliance-badge-large.danger {
    background-color: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
}

.badge-icon {
    font-size: 1.6rem;
    color: var(--color-success);
}

.warning .badge-icon { color: var(--color-warning); }
.danger .badge-icon { color: var(--color-danger); }

.badge-texts {
    display: flex;
    flex-direction: column;
}

.badge-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.badge-value {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--color-success);
}

.warning .badge-value { color: var(--color-warning); }
.danger .badge-value { color: var(--color-danger); }

/* Export Buttons Row */
.export-actions-row {
    padding: 1.2rem 2.2rem;
    background-color: rgba(15, 23, 42, 0.2);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 850px) {
    .export-actions-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

.export-actions-row h3 {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.export-buttons-group {
    display: flex;
    gap: 0.8rem;
}

.btn-export {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-export.docx {
    background-color: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: #93c5fd;
}

.btn-export.docx:hover {
    background-color: #2563eb;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-export.xlsx {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

.btn-export.xlsx:hover {
    background-color: #10b981;
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Tabs Navigation */
.dashboard-tabs {
    padding: 0 2.2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 1.5rem;
    background-color: rgba(15, 23, 42, 0.15);
}

.tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 1.1rem 0.2rem;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

/* Tab Panes content */
.tab-panes {
    padding: 2.2rem;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 600px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}

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

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

/* Pane Grid system */
.pane-grid-2 {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.8rem;
}

@media (max-width: 900px) {
    .pane-grid-2 {
        grid-template-columns: 1fr;
    }
}

.pane-card {
    background-color: rgba(15, 23, 42, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

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

.pane-card-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-column { display: flex; flex-direction: column; }
.jc-space-between { justify-content: space-between; }
.border-x {
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

/* Checklist compliance rules */
.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.checklist-item {
    background-color: rgba(30, 41, 59, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    display: grid;
    grid-template-columns: 32px 1fr 120px;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.checklist-item:hover {
    background-color: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.12);
}

.check-icon-box {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.check-icon-box.success {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
}

.check-icon-box.warning {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
}

.check-icon-box.danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
}

.check-details {
    display: flex;
    flex-direction: column;
}

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

.check-desc {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

.check-status-badge {
    text-align: right;
}

.status-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.status-chip.success {
    background-color: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--color-success);
}

.status-chip.warning {
    background-color: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--color-warning);
}

.status-chip.danger {
    background-color: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--color-danger);
}

/* Semi-circle Risk Gauge */
.gauge-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 1rem;
}

.gauge-meter {
    position: relative;
    width: 200px;
    height: 100px;
    border-radius: 100px 100px 0 0;
    background: conic-gradient(
        from 180deg at 50% 100%,
        var(--color-success) 0deg,
        var(--color-success) 60deg,
        var(--color-warning) 60deg,
        var(--color-warning) 120deg,
        var(--color-danger) 120deg,
        var(--color-danger) 180deg
    );
    overflow: hidden;
}

.gauge-meter::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 85px;
    background-color: var(--bg-secondary);
    border-radius: 85px 85px 0 0;
    z-index: 1;
}

.gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 80px;
    background-color: var(--text-primary);
    transform-origin: 50% 100%;
    transform: translateX(-50%) rotate(0deg); /* JS sets rotation from -90deg to +90deg */
    z-index: 2;
    transition: transform 1.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    border-radius: 4px;
}

.gauge-needle::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--text-primary);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.gauge-value {
    margin-top: 1rem;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.risk-stats-mini {
    display: flex;
    justify-content: space-around;
    background-color: rgba(30, 41, 59, 0.15);
    border-radius: var(--radius-sm);
    padding: 0.8rem;
}

.stat-mini {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 1.3rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

/* Ratios Grid List */
.ratios-grid-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.6rem;
}

.ratio-card-compact {
    background-color: rgba(30, 41, 59, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.ratio-card-compact:hover {
    background-color: rgba(30, 41, 59, 0.35);
    border-color: var(--border-hover);
}

.ratio-info-left {
    display: flex;
    flex-direction: column;
}

.ratio-title-compact {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ratio-meta-compact {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.ratio-value-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.ratio-num-val {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.ratio-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ratio-indicator-dot.success { background-color: var(--color-success); box-shadow: 0 0 6px var(--color-success); }
.ratio-indicator-dot.warning { background-color: var(--color-warning); box-shadow: 0 0 6px var(--color-warning); }
.ratio-indicator-dot.danger { background-color: var(--color-danger); box-shadow: 0 0 6px var(--color-danger); }

/* Chart Container */
.chart-container {
    position: relative;
    margin: auto;
    height: 280px;
    width: 100%;
}

/* Sub tabs for Financial Statements */
.statements-tabs-sub {
    display: flex;
    gap: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-sub-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.tab-sub-btn:hover {
    color: var(--text-primary);
}

.tab-sub-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.subtab-pane {
    display: none;
}

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

/* Financial Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.financial-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.financial-table th, .financial-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.financial-table th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-secondary);
    background-color: rgba(15, 23, 42, 0.2);
}

.financial-table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.financial-table td.text-right, .financial-table th.text-right {
    text-align: right;
}

.financial-table tr.total-row {
    font-weight: 700;
    background-color: rgba(59, 130, 246, 0.06);
    border-top: 1px solid rgba(59, 130, 246, 0.3);
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
}

.financial-table tr.total-row td {
    color: var(--text-primary);
}

.financial-table tr.main-category {
    font-weight: 600;
    color: #93c5fd;
    background-color: rgba(15, 23, 42, 0.1);
}

/* AI Report View */
.ai-header-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    background-color: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-sm);
}

.ai-pulse-icon {
    font-size: 1.8rem;
    color: var(--color-primary);
    animation: pulse 2s ease-in-out infinite;
}

.ai-report-box {
    background-color: rgba(11, 15, 25, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(248, 250, 252, 0.95);
    max-height: 400px;
    overflow-y: auto;
}

.ai-report-box h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-top: 1.2rem;
    margin-bottom: 0.4rem;
    color: #93c5fd;
}

.ai-report-box h4:first-of-type {
    margin-top: 0;
}

.ai-report-box p {
    margin-bottom: 0.8rem;
}

.ai-report-box ul, .ai-report-box ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.ai-report-box li {
    margin-bottom: 0.4rem;
}

.ai-report-box blockquote {
    border-left: 3px solid var(--color-primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
    background-color: rgba(15, 23, 42, 0.2);
    padding: 0.6rem 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Footer styling */
.app-footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    background-color: rgba(15, 23, 42, 0.5);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* Animations */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.85; filter: drop-shadow(0 0 0 rgba(59, 130, 246, 0)); }
    50% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.4)); }
    100% { transform: scale(1); opacity: 0.85; filter: drop-shadow(0 0 0 rgba(59, 130, 246, 0)); }
}

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