@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #F2F4F7;
    /* Light Gray Background */
    --surface-color: #FFFFFF;
    /* Pure White Cards */
    --text-primary: #1D1D1D;
    /* Soft Black */
    --text-secondary: #8E8E93;
    /* Gray Text */
    --accent-black: #1A1A1A;
    /* Accent Black */
    --border-radius: 24px;
    /* Generous Rounding */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.03);
    /* Extremely soft shadow */

    /* Sidebar Redesign Variables */
    --sidebar-bg: #111111;
    --sidebar-text-active: #000000;
    --sidebar-bg-active: #FFFFFF;
    --sidebar-text-inactive: #A1A1A1;
    --sidebar-hover: #1F1F1F;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

.admin-container {
    display: flex;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    gap: 20px;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    /* Dark Theme */
    border-radius: var(--border-radius);
    padding: 32px 20px;
    /* Adjusted padding */
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    /* Stronger shadow for floating effect */
    color: white;
    /* Default text color in sidebar */
}

.sidebar-brand {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 48px;
    color: white;
    /* Logo text white */
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
    justify-content: center;
    /* Center logo */
}

/* Navigation Links */
.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    /* 48px height approx */
    color: var(--sidebar-text-inactive);
    text-decoration: none;
    font-weight: 500;
    border-radius: 12px;
    margin-bottom: 8px;
    /* 12px gap */
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--sidebar-hover);
    color: white;
}

.nav-link.active {
    background-color: var(--sidebar-bg-active);
    color: var(--sidebar-text-active);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.nav-link svg {
    width: 20px;
    height: 20px;
    margin-right: 14px;
    stroke-width: 2px;
}

/* Upgrade Card (Similar to Image) */
.upgrade-card {
    margin-top: auto;
    background: linear-gradient(135deg, #2C2C2E 0%, #000000 100%);
    border-radius: 20px;
    padding: 24px;
    color: white;
    text-align: center;
}

.upgrade-card h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.upgrade-card p {
    font-size: 12px;
    opacity: 0.7;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.upgrade-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    width: 100%;
}

/* Main Content */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    padding-right: 10px;
    /* Space for scrollbar */
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.header-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

/* Clean White Card */
.white-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--shadow-soft);
    position: relative;
    border: 1px solid white;
    /* Subtle border */
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.badge-step {
    background: #F3F4F6;
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* Drop Zone (Minimal) */
.drop-zone {
    border: 2px dashed #E5E7EB;
    border-radius: 18px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #FAFAFA;
}

.drop-zone:hover {
    border-color: var(--accent-black);
    background: #F5F5F5;
}

.icon-box {
    width: 48px;
    height: 48px;
    background: #F3F4F6;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    color: var(--text-primary);
}

/* Button Standards */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 14px;
    /* Consistent radius */
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 8px;
    line-height: 1;
}

.btn:active {
    transform: scale(0.98);
}

/* Primary: Black (Like 'Login' button in sample) */
.btn-primary {
    background: #000000;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    background: #1A1A1A;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-primary:disabled {
    background: #E5E7EB;
    color: #9CA3AF;
    box-shadow: none;
    cursor: not-allowed;
}

/* Secondary: White/Gray (Like 'Cancel' or 'Filters') */
.btn-secondary {
    background: #FFFFFF;
    color: #1F2937;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

/* Accent/Success: Green (for Downloads) */
.btn-success {
    background: #10B981;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: #059669;
}

/* Danger: Red (for Reset) */
.btn-danger {
    background: #EF4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #DC2626;
}

/* Small variant */
.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 10px;
}

/* Full width util */
.w-full {
    width: 100%;
}

/* Status Box */
.status-box {
    background: #F8F9FB;
    border-radius: 14px;
    padding: 16px;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Toggle Switch Style Radio */
.toggle-group {
    background: #F3F4F6;
    padding: 4px;
    border-radius: 12px;
    display: inline-flex;
    margin-top: 20px;
}

.toggle-option {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.toggle-option.selected {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Terminal */
#logArea {
    width: 100%;
    height: 150px;
    background: #111;
    color: #33ff00;
    border-radius: 16px;
    padding: 20px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    border: none;
    resize: none;
    box-sizing: border-box;
}

/* Scrollbar Hide */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* =========================================
   Stats Card Component (New Data Tools UI - Vertical Layout)
   ========================================= */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Slightly stronger shadow */
    border: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Force fill grid height */
    min-height: 500px;
}

.top-section {
    margin-bottom: 20px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.metric-label {
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 4px;
}

.big-metric {
    font-size: 42px;
    /* Original was 36, made bigger */
    font-weight: 800;
    color: #111827;
    line-height: 1;
    margin-bottom: 8px;
}

.meta-row {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 18px;
    /* Always reserve 1 line height */
}

/* Thick Divider */
.card-divider {
    border: 0;
    border-top: 2px solid #111827;
    /* Hard Black */
    margin: 20px 0;
    opacity: 0.1;
    /* Slightly softer */
}

/* Steps */
.step-section {
    margin-bottom: 24px;
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.step-time {
    font-size: 11px;
    color: #6B7280;
    font-weight: 400;
}

.file-info {
    font-size: 12px;
    color: #374151;
    margin-bottom: 10px;
    word-break: break-all;
}

/* Full Width Black Button */
.btn-full-black {
    width: 100%;
    background-color: #111827;
    /* Tailwind Gray-900 */
    color: white;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background-color 0.2s;
}

.btn-full-black:hover {
    background-color: #000000;
}

.btn-full-black:disabled {
    background-color: #E5E7EB;
    color: #9CA3AF;
    cursor: not-allowed;
}

/* Custom Progress Bar for this layout */
.progress-group {
    margin-bottom: 12px;
}

.progress-group label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #4B5563;
    margin-bottom: 4px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #F3F4F6;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #10B981;
    /* Default Teal */
    width: 0%;
    transition: width 0.3s ease;
}

.progress-bar-fill.yellow {
    background: #F59E0B;
}

.restore-info {
    font-size: 11px;
    color: #059669;
    background: #ECFDF5;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: none;
    /* Hidden by default */
    height: 50px;
    overflow-y: auto;
}

/* Thick Progress Bars */
.progress-container {
    margin-bottom: 16px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.thick-progress {
    height: 12px;
    background: #F3F4F6;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-teal {
    background: #14B8A6;
}

.bar-yellow {
    background: #F59E0B;
}

.bar-blue {
    background: #3B82F6;
}

/* Action Area */
.action-area {
    display: flex;
    gap: 10px;
    margin-top: auto;
    /* Push to bottom */
}

.btn-sm {
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: #111827;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #374151;
}

.btn-secondary {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    color: #374151;
}

.btn-secondary:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}