/* ==========================================
   VIBE Costs Organizer - Styling System
   ========================================== */

:root {
    --bg-dark: #070b13;
    --bg-light: #f8fafc;
    --card-dark: rgba(15, 23, 42, 0.45);
    --card-light: rgba(255, 255, 255, 0.7);
    --border-dark: rgba(255, 255, 255, 0.08);
    --border-light: rgba(0, 0, 0, 0.06);
    --text-dark: #f8fafc;
    --text-light: #0f172a;
    --text-muted-dark: #94a3b8;
    --text-muted-light: #64748b;
    
    --primary: #10b981; /* Emerald Green */
    --primary-glow: rgba(16, 185, 129, 0.35);
    --warning: #f59e0b; /* Amber */
    --warning-glow: rgba(245, 158, 11, 0.35);
    --danger: #ef4444; /* Coral Red */
    --danger-glow: rgba(239, 68, 68, 0.35);
    --border-radius: 16px;
    --font-sans: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Light / Dark Mode Switches */
body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
    --card-bg: var(--card-dark);
    --card-border: var(--border-dark);
    --text-color: var(--text-dark);
    --text-muted: var(--text-muted-dark);
}

body.light-mode {
    background-color: var(--bg-light);
    color: var(--text-light);
    --card-bg: var(--card-light);
    --card-border: var(--border-light);
    --text-color: var(--text-light);
    --text-muted: var(--text-muted-light);
}

/* Glowing Background Orbs (Dark Mode Only) */
.glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.dark-mode .glow-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.15;
    mix-blend-mode: screen;
    animation: orb-float 20s infinite alternate;
}
.dark-mode #orb-1 {
    background: var(--primary);
    top: -10%;
    right: -10%;
}
.dark-mode #orb-2 {
    background: #0ea5e9; /* Sky Blue */
    bottom: -10%;
    left: -10%;
    animation-delay: -5s;
}

@keyframes orb-float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 50px) scale(1.1); }
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(10, 15, 30, 0.2);
    backdrop-filter: blur(10px);
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
}
.logo-icon {
    font-size: 32px;
}
.logo-text h1 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.logo-text p {
    font-size: 12.5px;
    color: var(--text-muted);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 13.5px;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--primary-glow);
    background: #059669;
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid var(--card-border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    font-size: 16px;
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Dashboard Grid Layout */
.dashboard-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 32px;
    padding: 32px 40px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Cards (Glassmorphism) */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 24px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.left-pane {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.main-pane {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}
.section-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Ingestion Checklist */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.check-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
}
.check-item.completed {
    border-color: rgba(16, 185, 129, 0.15);
    background: rgba(16, 185, 129, 0.02);
}
.check-item.completed .check-icon {
    color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
}
.check-item.pending {
    border-color: rgba(245, 158, 11, 0.15);
    background: rgba(245, 158, 11, 0.02);
}
.check-item.pending .check-icon {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}
.check-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}
.check-text h3 {
    font-size: 13.5px;
    font-weight: 600;
}
.check-text p {
    font-size: 11px;
    color: var(--text-muted);
}

/* Upload Drop Zone */
.drop-zone {
    border: 2px dashed var(--card-border);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255,255,255,0.01);
}
.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.02);
}
.drop-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
}
.drop-zone p {
    font-size: 13.5px;
    margin-bottom: 4px;
}
.drop-sub {
    font-size: 10.5px;
    color: var(--text-muted);
    display: block;
}

/* Uploading files progress list */
.upload-progress-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.progress-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    font-size: 12px;
}
.progress-name {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.progress-status {
    color: var(--primary);
    font-weight: bold;
}

/* KPIs */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.kpi-card {
    display: flex;
    align-items: center;
    gap: 20px;
}
.kpi-icon {
    font-size: 28px;
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
}
.kpi-data {
    display: flex;
    flex-direction: column;
}
.kpi-value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
}
.kpi-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Surcharge Card highlights */
#kpi-balance-card.surcharge-due {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.02);
}
#kpi-balance-card.surcharge-due .kpi-value {
    color: var(--danger);
}

/* Workspace Card with Tabs */
.workspace-card {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.card-header-tabs {
    padding: 16px 24px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(0,0,0,0.05);
}
.tabs-nav {
    display: flex;
    gap: 8px;
}
.tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.tab-btn.active {
    background: rgba(255,255,255,0.05);
    color: var(--text-color);
    box-shadow: inset 0 1px 1px var(--card-border);
}
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}
.tab-content.active {
    display: block;
}

/* Tables */
.table-container {
    width: 100%;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
th {
    padding: 16px 24px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--card-border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    font-size: 13px;
    vertical-align: middle;
}
tr:hover td {
    background: rgba(255,255,255,0.01);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.badge-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.15);
}
.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.15);
}
.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* Export Cards footer */
.export-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(0,0,0,0));
    border-color: rgba(16, 185, 129, 0.15);
}
.export-left h2 {
    color: var(--text-color);
}

/* Export Results Panel */
.export-results-panel {
    animation: fade-slide-in 0.4s ease-out forwards;
}
@keyframes fade-slide-in {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.export-status-success {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 20px;
}
.success-icon {
    font-size: 24px;
    color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.success-details h3 {
    font-size: 15px;
    font-weight: 600;
}
.success-details code {
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

.export-files-list h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-muted);
}
.download-cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.download-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}
.download-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--primary);
}
.dl-icon {
    font-size: 24px;
}
.dl-details {
    flex: 1;
    overflow: hidden;
}
.dl-name {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dl-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--card-border);
    margin-top: 40px;
}

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