:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-primary: #0284c7;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --border-color: #e2e8f0;
    --header-height: 70px;
    --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body, html {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.view {
    display: none;
    height: 100%;
    flex-direction: column;
}

.view.active {
    display: flex;
}

/* Splash */
#splash-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 100%);
}

.splash-card {
    background: white;
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 500px;
    border: 1px solid var(--border-color);
}

.logo i { font-size: 4rem; color: var(--accent-primary); margin-bottom: 1.5rem; }
.logo h1 { font-size: 2.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.logo p { color: var(--text-secondary); margin-bottom: 2.5rem; font-size: 1.1rem; }

.env-buttons { display: flex; flex-direction: column; gap: 1rem; }

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-lg { font-size: 1.25rem; padding: 1.25rem 2.5rem; }
.btn-sm { font-size: 0.9rem; padding: 0.6rem 1.25rem; }

.btn-primary { background: var(--accent-primary); color: white; }
.btn-danger { background: var(--danger-color); color: white; }
.btn-secondary { background: white; border: 1px solid var(--border-color); color: var(--text-secondary); }

.btn:hover { filter: brightness(1.05); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn:active { transform: translateY(0); }

/* Main Header */
.main-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    flex-shrink: 0;
    z-index: 100;
}

.app-title { font-weight: 800; font-size: 1.5rem; color: var(--text-primary); letter-spacing: -0.5px; }

.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 800;
    margin-left: 1.5rem;
}

.badge-success { background: #dcfce7; color: #16a34a; border: 1px solid #86efac; }
.badge-danger { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }

/* Split Layout */
.workspace-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 0; /* Important for flex-grow containers */
    overflow: hidden;
}

.pane {
    display: flex;
    flex-direction: column;
    background: white;
    min-height: 0;
}

.directory-pane {
    flex: 0 0 40%;
    border-bottom: 3px solid var(--border-color);
}

.hub-pane {
    flex: 1;
    background: var(--bg-primary);
}

.pane-header {
    padding: 0.75rem 1.5rem;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Scrollable Container for Directory */
.directory-list-container {
    flex: 1;
    overflow-y: auto;
    background: white;
}

/* Scrollable Container for Hub */
#hub-workspace {
    overflow-y: auto;
    height: 100%;
}

.replacement-hub {
    padding: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    text-align: left;
    padding: 1.25rem 1.5rem;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    z-index: 10;
}

.data-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.1rem;
}

.data-table tr:hover { background: #f1f5f9; cursor: pointer; }
.data-table tr.active-row { background: #e0f2fe; }

/* Panels */
.workflow-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Upload Zone */
.upload-zone {
    padding: 4rem 2rem;
    text-align: center;
    border: 3px dashed var(--border-color);
    margin: 1.5rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.upload-zone:hover { border-color: var(--accent-primary); background: #f0f9ff; }
.upload-zone i { font-size: 3.5rem; color: var(--accent-primary); margin-bottom: 1rem; }

/* Utilities */
.bucket-info-bar {
    margin-left: auto;
    background: var(--accent-primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: monospace;
}