/* 
 * CPA Codex Credential Monitor
 * Premium Light-Mode Monochrome Theme (Pure White & Light Gray Style)
 * Inspired by Apple's clean white aesthetic and Stripe/Vercel light designs.
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-main: #ffffff;           /* Pure White Background */
    --bg-card: #ffffff;           /* Card White */
    --bg-nested: #f4f4f5;         /* Zinc-100 (Very Light Gray) */
    --border-color: #e4e4e7;      /* Zinc-200 (Clean Light Border) */
    
    /* Typography */
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Light-Mode Typography Colors */
    --text-primary: #09090b;      /* Zinc-950 (Rich Charcoal Black) */
    --text-secondary: #71717a;    /* Zinc-500 (Medium Neutral Gray) */
    --text-muted: #a1a1aa;        /* Zinc-400 (Soft Light Gray) */
    
    /* Subtle Functional Status Colors */
    --color-success: #15803d;     /* Deep Green for Active */
    --color-success-dot: #22c55e;
    --color-danger: #b91c1c;      /* Deep Red for 401 */
    --color-danger-dot: #ef4444;
    --color-warning: #b45309;     /* Deep Orange for Anomaly */
    --color-warning-dot: #f59e0b;
    --color-disabled: #27272a;    /* Dark Gray for Disabled */
    --color-disabled-dot: #71717a;
    
    /* Sizing & Borders */
    --border-radius-lg: 0.75rem;   /* 12px */
    --border-radius-md: 0.5rem;    /* 8px */
    --border-radius-sm: 0.375rem;  /* 6px */
    
    /* Soft shadows matching light mode */
    --shadow-main: 0 4px 20px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.06);
    
    --transition-base: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px 24px;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar - Minimalist Light */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

.app-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Elegant Light Floating Header */
.app-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-main);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: #09090b;
}

.logo-text h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #09090b;
}

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

.header-status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-success-dot);
    box-shadow: 0 0 6px var(--color-success-dot);
}

/* Minimalist Clean Cards */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-main);
    padding: 12px 18px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.panel-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.1px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.panel-header i {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

/* Configuration Grid */
.config-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 0.5fr 1.1fr;
    gap: 20px;
    align-items: flex-end;
}

@media (max-width: 991px) {
    .config-grid {
        grid-template-columns: 1fr 1fr;
    }
    .project-selector-wrapper {
        grid-column: span 2 !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .config-action {
        grid-column: span 2;
    }
}

@media (max-width: 575px) {
    .config-grid {
        grid-template-columns: 1fr;
    }
    .project-selector-wrapper, .config-action {
        grid-column: span 1 !important;
    }
}

/* Saved Projects Bar - Compact Row Layout */
.project-selector-wrapper {
    grid-column: span 4;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 4px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.project-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
}

.project-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Minimalist Chips - Light Mode */
.project-chip {
    padding: 5px 12px;
    background: var(--bg-nested);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-base);
}

.project-chip:hover {
    background: #e4e4e7;
    color: var(--text-primary);
}

.project-chip.active {
    background-color: var(--text-primary);
    border-color: var(--text-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(9, 9, 11, 0.15);
}

.btn-chip-delete {
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.6;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    transition: var(--transition-base);
}

.btn-chip-delete:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Input Fields - Crisp White */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 9px 12px;
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition-base);
}

.input-group input:focus {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px rgba(9, 9, 11, 0.05);
}

/* Minimalist Action Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition-base);
    border: 1px solid transparent;
    font-family: var(--font-sans);
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

/* Clean White Page -> Solid Black Primary Button */
.btn-primary {
    background-color: var(--text-primary);
    color: #ffffff;
    border-color: var(--text-primary);
}

.btn-primary:hover:not(:disabled) {
    background-color: #27272a;
    border-color: #27272a;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(9, 9, 11, 0.15);
}

/* Light Outline Button */
.btn-secondary {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-nested);
    border-color: #d4d4d8;
    transform: translateY(-1px);
}

/* Crimson Border Button for Operations */
.btn-danger {
    background: #ffffff;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.05);
    border-color: #ef4444;
    transform: translateY(-1px);
}

/* Stats Cards - Clean and Hoverable */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-main);
    transition: var(--transition-base);
}

.stat-card:hover {
    border-color: #a1a1aa;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Light Icon Boxes */
.stat-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    background-color: var(--bg-nested);
}

.stat-icon-wrapper i {
    width: 18px;
    height: 18px;
}

.time-text {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: inherit;
}

/* Unique state styling overrides for Statistics Cards */
.stat-card.total {
    background-color: #fafafa;
    border-color: #d4d4d8;
}
.stat-card.total h3 {
    color: #09090b;
}
.stat-card.total .stat-icon-wrapper {
    background-color: #09090b;
    color: #ffffff;
    border-color: #09090b;
}

.stat-card.active {
    background-color: rgba(34, 197, 94, 0.04);
    border-color: rgba(34, 197, 94, 0.2);
}
.stat-card.active h3 {
    color: #16a34a;
}
.stat-card.active .stat-icon-wrapper {
    background-color: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.15);
}

.stat-card.unauthorized {
    background-color: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.2);
}
.stat-card.unauthorized h3 {
    color: #dc2626;
}
.stat-card.unauthorized .stat-icon-wrapper {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.15);
}

.stat-card.disabled {
    background-color: #f4f4f5;
    border-color: #e4e4e7;
    opacity: 0.8;
}
.stat-card.disabled h3 {
    color: #71717a;
}
.stat-card.disabled .stat-icon-wrapper {
    background-color: rgba(0, 0, 0, 0.05);
    color: #71717a;
    border-color: rgba(0, 0, 0, 0.08);
}

.stat-card.error {
    background-color: rgba(245, 158, 11, 0.04);
    border-color: rgba(245, 158, 11, 0.2);
}
.stat-card.error h3 {
    color: #d97706;
}
.stat-card.error .stat-icon-wrapper {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.15);
}

.stat-card.time {
    background-color: rgba(37, 99, 235, 0.03);
    border-color: rgba(37, 99, 235, 0.15);
}
.stat-card.time h3 {
    color: #2563eb;
}
.stat-card.time .stat-icon-wrapper {
    background-color: rgba(37, 99, 235, 0.08);
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.12);
}

/* Toolbar Panel */
.toolbar-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: var(--shadow-main);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    width: 260px;
}

.search-box input {
    width: 100%;
    background: #ffffff;
    border: 1px solid #c4c4c7;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    padding: 6px 12px;
    font-size: 0.8rem;
    height: 34px;
    box-sizing: border-box;
    outline: none;
    transition: var(--transition-base);
}

.search-box input:focus {
    border-color: var(--text-primary);
}

/* Soft Tab Filters - Light */
.filter-group {
    display: flex;
    background: var(--bg-nested);
    border: 1px solid var(--border-color);
    padding: 3px;
    border-radius: var(--border-radius-sm);
}

.btn-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
    text-transform: uppercase;
}

.btn-tab.active {
    background: #ffffff;
    color: var(--text-primary);
    box-shadow: var(--shadow-main);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Two-column layout grid */
.data-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 24px;
}

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

/* Table Area - Light Clean */
.table-panel {
    display: flex;
    flex-direction: column;
}

.badge {
    background: var(--bg-nested);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.table-container {
    overflow-y: auto;
    overflow-x: auto;
    max-height: 480px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #fafafa;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 12px 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 11px 16px;
    border-bottom: 1px solid #f4f4f5;
    font-size: 0.82rem;
    color: var(--text-primary);
}

tbody tr {
    transition: var(--transition-base);
}

tbody tr:hover {
    background-color: #fafafa;
}

.empty-state {
    text-align: center;
    padding: 80px 0 !important;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Clean, modern pastel status badges with glowing dots - Light Mode readable */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
    gap: 6px;
}

.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-badge.active { 
    background-color: rgba(34, 197, 94, 0.08);
    color: var(--color-success); 
    border-color: rgba(34, 197, 94, 0.2); 
}
.status-badge.active::before { 
    background-color: var(--color-success-dot); 
    box-shadow: 0 0 6px var(--color-success-dot); 
}

.status-badge.unauthorized { 
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--color-danger); 
    border-color: rgba(239, 68, 68, 0.2); 
}
.status-badge.unauthorized::before { 
    background-color: var(--color-danger-dot); 
    box-shadow: 0 0 6px var(--color-danger-dot); 
}

.status-badge.disabled { 
    background-color: rgba(244, 244, 245, 1);
    color: var(--color-disabled-dot); 
    border-color: var(--border-color); 
}
.status-badge.disabled::before { 
    background-color: var(--color-disabled-dot); 
}

.status-badge.error { 
    background-color: rgba(245, 158, 11, 0.08);
    color: var(--color-warning); 
    border-color: rgba(245, 158, 11, 0.2); 
}
.status-badge.error::before { 
    background-color: var(--color-warning-dot); 
    box-shadow: 0 0 6px var(--color-warning-dot); 
}

/* Typography Mono styles */
.cell-id {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.cell-account {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-primary);
}

.cell-message {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-message:hover {
    white-space: normal;
    word-break: break-all;
}

/* Action button in table */
.btn-action {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-action:hover {
    background: var(--bg-nested);
    border-color: #c4c4c7;
    color: var(--text-primary);
}

.btn-action.delete-btn {
    border-color: rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.btn-action.delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.06);
    border-color: #ef4444;
}

/* Pagination Panel */
.pagination-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-left {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-left select {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    outline: none;
    font-size: 0.8rem;
    padding: 4px 8px;
    cursor: pointer;
}

.pagination-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-page {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition-base);
}

.btn-page:hover:not(:disabled) {
    background: var(--bg-nested);
    border-color: #c4c4c7;
    color: var(--text-primary);
}

.btn-page:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.page-indicator {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0 10px;
    color: var(--text-primary);
}

/* Clean light console log panel */
.logs-panel {
    display: flex;
    flex-direction: column;
}

.logs-console {
    background: var(--bg-nested);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.6;
    min-height: 360px;
    max-height: 480px;
}

.log-line {
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
    padding: 6px 0;
    word-break: break-all;
    white-space: pre-wrap;
}

.log-line.info { color: var(--text-primary); }
.log-line.warn { color: var(--color-warning); }
.log-line.error { color: var(--color-danger); }
.log-line.system { color: #09090b; font-weight: 700; }

/* Custom confirmation modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-overlay.hidden {
    display: none;
}

.modal-box {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.modal-icon-header {
    display: flex;
    justify-content: center;
}

.modal-icon {
    width: 44px;
    height: 44px;
    padding: 10px;
    border-radius: 50%;
}

.modal-icon.warning {
    color: var(--color-warning-dot);
    background: rgba(245, 158, 11, 0.1);
}

.modal-icon.danger {
    color: var(--color-danger-dot);
    background: rgba(239, 68, 68, 0.1);
}

.modal-box h3 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

.modal-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modal-input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.modal-input-area label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.modal-input-area input {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 2px;
    outline: none;
    transition: var(--transition-base);
}

.modal-input-area input:focus {
    border-color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.modal-actions button {
    flex: 1;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 20000;
}

.toast {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 12px 18px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    border-left: 3px solid var(--text-primary);
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.success { border-left-color: var(--color-success-dot); }
.toast.error { border-left-color: var(--color-danger-dot); }

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Footer style */
.app-footer-bar {
    text-align: center;
    padding: 20px 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 15px;
}

/* Progress Bar Styles with Stage Accent Colors */
.progress-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-main);
    transition: var(--transition-base);
}

.progress-bar-track {
    background: var(--bg-nested);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
    width: 0%;
}

.progress-stage-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

/* Stage Colors & Shades */
/* Stage 1: Init - Zinc Gray */
.progress-bar-fill.stage-init {
    background-color: #71717a;
}
.progress-stage-badge.stage-init {
    background-color: rgba(113, 113, 122, 0.08);
    border: 1px solid rgba(113, 113, 122, 0.2);
    color: #71717a;
}

/* Stage 2: Scanning - Amber / Gold */
.progress-bar-fill.stage-scanning {
    background-color: #f59e0b;
}
.progress-stage-badge.stage-scanning {
    background-color: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #d97706;
}

/* Stage 3: Summarizing - Deep Blue */
.progress-bar-fill.stage-summarizing {
    background-color: #2563eb;
}
.progress-stage-badge.stage-summarizing {
    background-color: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: #2563eb;
}

/* Stage 4: Completed - Green */
.progress-bar-fill.stage-completed {
    background-color: #16a34a;
}
.progress-stage-badge.stage-completed {
    background-color: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #16a34a;
}

/* Chinese Heritage Theme Variables & Visual Overrides (古风墨雅) */
body.theme-chinese {
    --bg-main: #fcfaf2;           /* 宣纸白 - Warm Chinese Calligraphy Paper */
    --bg-card: #f7f4ea;           /* 暖玉色 - Cream Lanolin Jade White */
    --bg-nested: #eae5d9;         /* 黛灰 - Ink-wash Light Gray */
    --border-color: #d8d0bd;      /* 旧竹黄 - Aged Bamboo Reed Border */
    
    --text-primary: #2d2925;      /* 漆黑/松烟墨 - Calligraphic Charcoal Black */
    --text-secondary: #5e5952;    /* 黛蓝灰 - Indigo Ink-wash Charcoal */
    --text-muted: #8e887e;        /* 枯草灰 - Muted Ancient Earth Gray */
    
    /* Traditional Functional Colors */
    --color-success: #1a6840;     /* 石绿/竹青 - Bamboo Forest Green */
    --color-success-dot: #579572;
    --color-danger: #ab3a2a;      /* 朱红/朱砂 - Cinnabar Vermilion */
    --color-danger-dot: #f47983;  /* 海天霞 */
    --color-warning: #c1912a;     /* 秋香黄 - Ochre Yellow-Green */
    --color-warning-dot: #d8c06a;
    --color-disabled: #546e7a;    /* 黛蓝 - Slate Blue */
    --color-disabled-dot: #78909c;

    --border-radius-lg: 4px;      /* Sharp printed blocks like Chinese seals */
    --border-radius-md: 2px;
    --border-radius-sm: 0px;

    --shadow-main: 2px 2px 8px rgba(45, 41, 35, 0.05);
    --shadow-lg: 4px 4px 18px rgba(45, 41, 35, 0.09);
    
    --font-sans: 'Noto Serif SC', 'Playfair Display', 'SimSun', 'Songti SC', serif;
}

body.theme-chinese {
    background-image: 
        radial-gradient(at 0% 0%, rgba(171, 58, 42, 0.012) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(45, 41, 35, 0.015) 0px, transparent 50%);
}

/* Custom Red Stamp Border-Left for panel headers */
body.theme-chinese .panel-header h2 {
    border-left: 3px solid #ab3a2a;
    padding-left: 10px;
    font-weight: 700;
}

/* Cinnabar Seal/Stamp Styling for Primary Buttons */
body.theme-chinese .btn-primary {
    background-color: #ab3a2a !important;
    border-color: #ab3a2a !important;
    color: #fcfaf2 !important;
    font-weight: 700;
    box-shadow: 2px 2px 0px #2d2925 !important; /* Sharp Retro Seal Shadow */
}
body.theme-chinese .btn-primary:hover:not(:disabled) {
    background-color: #933022 !important;
    border-color: #933022 !important;
    transform: translate(1px, 1px) !important;
    box-shadow: 1px 1px 0px #2d2925 !important;
}

/* Secondary Button Stamp Outline Style */
body.theme-chinese .btn-secondary {
    background-color: #f7f4ea !important;
    border: 1px solid #ab3a2a !important;
    color: #ab3a2a !important;
    font-weight: 700;
}
body.theme-chinese .btn-secondary:hover:not(:disabled) {
    background-color: rgba(171, 58, 42, 0.05) !important;
    border-color: #933022 !important;
    color: #933022 !important;
}

/* Active Project Chip resembles a small red stamp */
body.theme-chinese .project-chip.active {
    background-color: #ab3a2a !important;
    border-color: #ab3a2a !important;
    color: #fcfaf2 !important;
    box-shadow: 1px 1px 3px rgba(171, 58, 42, 0.3) !important;
}

/* Tabs inside Chinese theme */
body.theme-chinese .btn-tab.active {
    background-color: #ab3a2a !important;
    color: #fcfaf2 !important;
    box-shadow: 1px 1px 3px rgba(171, 58, 42, 0.2) !important;
}

/* Stat Cards styled like traditional books or bamboo slips with custom color slips */
body.theme-chinese .stat-card {
    border-top: 3px solid #d8d0bd;
    border-radius: 4px 4px 2px 2px;
}
body.theme-chinese .stat-card.total {
    border-top-color: #2d2925;
}
body.theme-chinese .stat-card.active {
    border-top-color: #1a6840;
}
body.theme-chinese .stat-card.unauthorized {
    border-top-color: #ab3a2a;
}
body.theme-chinese .stat-card.disabled {
    border-top-color: #546e7a;
}
body.theme-chinese .stat-card.error {
    border-top-color: #c1912a;
}
body.theme-chinese .stat-card.time {
    border-top-color: #8e887e;
}
body.theme-chinese .stat-card.quota-ample {
    border-top-color: #1a6840;
}
body.theme-chinese .stat-card.quota-low {
    border-top-color: #c1912a;
}
body.theme-chinese .stat-card.quota-exhausted {
    border-top-color: #ab3a2a;
}
