/* ══════════════════════════════════════════════════════════════
   EPUBKit — Clean Light SaaS Theme v3
   Light palette, subtle shadows, rich accents
   ══════════════════════════════════════════════════════════════ */

/* ── Google Fonts ────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; }

/* ── Clean Light Color Palette ─────────────────────────────── */
:root {
    /* Light backgrounds */
    --bg-body: #f5f7fa;
    --bg-sidebar: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.9);
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fb;
    --bg-elevated: #f0f2f5;
    --bg-input: #f5f7fa;

    /* Borders — subtle dark */
    --border-primary: rgba(0, 0, 0, 0.08);
    --border-secondary: rgba(0, 0, 0, 0.04);
    --border-accent: rgba(0, 0, 0, 0.12);

    /* Text */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-bright: #111827;

    /* Accent colors — vivid (same on light/dark) */
    --blue-400: #3b82f6;
    --blue-500: #2563eb;
    --blue-600: #1d4ed8;
    --purple-400: #a78bfa;
    --purple-500: #8b5cf6;
    --purple-600: #7c3aed;
    --green-400: #22c55e;
    --green-500: #16a34a;
    --red-400: #ef4444;
    --red-500: #dc2626;
    --amber-400: #f59e0b;
    --amber-500: #d97706;
    --cyan-400: #06b6d4;
    --teal-400: #14b8a6;

    /* Glow effects — lighter on white */
    --glow-blue: rgba(37, 99, 235, 0.08);
    --glow-purple: rgba(139, 92, 246, 0.08);
    --glow-green: rgba(22, 163, 74, 0.08);
    --glow-red: rgba(239, 68, 68, 0.08);
    --glow-amber: rgba(217, 119, 6, 0.08);
}

/* ── Layout Utilities ─────────────────────────────────────── */
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; } .gap-5 { gap: 1.25rem; } .gap-6 { gap: 1.5rem; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.h-full { height: 100%; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-64 { margin-left: 16rem; }
.overflow-y-auto { overflow-y: auto; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-y-0 { top: 0; bottom: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.z-10 { z-index: 10; } .z-20 { z-index: 20; } .z-30 { z-index: 30; }
.hidden { display: none; }
.inline-flex { display: inline-flex; }
.block { display: block; }
.inline-block { display: inline-block; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* ── Spacing ──────────────────────────────────────────────── */
.p-2 { padding: 0.5rem; } .p-3 { padding: 0.75rem; } .p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; } .p-6 { padding: 1.5rem; } .p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.pt-4 { padding-top: 1rem; } .pt-6 { padding-top: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; } .mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; } .mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* ── Typography ───────────────────────────────────────────── */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.leading-none { line-height: 1; }
.leading-tight { line-height: 1.25; }
.no-underline { text-decoration: none; }
a { text-decoration: none; color: inherit; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ── Colors (mapped to new palette) ──────────────────────── */
.text-white { color: var(--text-bright); }
.text-gray-100 { color: var(--text-primary); }
.text-gray-200 { color: #374151; }
.text-gray-300 { color: #4b5563; }
.text-gray-400 { color: var(--text-secondary); }
.text-gray-500 { color: var(--text-muted); }
.text-blue-400 { color: var(--blue-400); }
.text-blue-500 { color: var(--blue-500); }
.text-green-400 { color: var(--green-400); }
.text-green-500 { color: var(--green-500); }
.text-red-400 { color: var(--red-400); }
.text-red-500 { color: var(--red-500); }
.text-amber-400 { color: var(--amber-400); }
.text-purple-400 { color: var(--purple-400); }
.text-cyan-400 { color: var(--cyan-400); }

/* Backgrounds mapped to light palette */
.bg-gray-700 { background: #e5e7eb; }
.bg-gray-800 { background: var(--bg-card); }
.bg-gray-850 { background: var(--bg-elevated); }
.bg-gray-900 { background: var(--bg-sidebar); }
.bg-gray-950 { background: var(--bg-body); }
.bg-blue-600 { background: var(--blue-600); }
.bg-transparent { background: transparent; }

.border-gray-700 { border-color: var(--border-primary); }
.border-gray-800 { border-color: var(--border-secondary); }
.opacity-60 { opacity: 0.6; }

/* ── Borders & Radius ─────────────────────────────────────── */
.border { border: 1px solid; }
.border-b { border-bottom: 1px solid; }
.border-t { border-top: 1px solid; }
.border-2 { border: 2px solid; }
.border-dashed { border-style: dashed; }
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* ── Shadows & Effects ────────────────────────────────────── */
.shadow-lg { box-shadow: 0 8px 24px rgba(0,0,0,0.06), 0 0 0 1px var(--border-secondary); }
.shadow-xl { box-shadow: 0 16px 48px rgba(0,0,0,0.08), 0 0 0 1px var(--border-secondary); }
.backdrop-blur-md { backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%); }
.transition-all { transition: all 0.2s ease; }
.transition-colors { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
.transition-transform { transition: transform 0.2s ease; }
.duration-200 { transition-duration: 200ms; }
.translate-x-0 { transform: translateX(0); }
.-translate-x-full { transform: translateX(-100%); }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.pointer-events-none { pointer-events: none; }

/* ── Gradient Backgrounds ─────────────────────────────────── */
.bg-gradient-to-r { background: linear-gradient(to right, var(--tw-gradient-from), var(--tw-gradient-to)); }
.bg-gradient-to-br { background: linear-gradient(to bottom right, var(--tw-gradient-from), var(--tw-gradient-to)); }
.from-blue-500 { --tw-gradient-from: var(--blue-500); }
.from-blue-600 { --tw-gradient-from: var(--blue-600); }
.from-purple-600 { --tw-gradient-to: var(--purple-600); }
.to-purple-600 { --tw-gradient-to: var(--purple-600); }
.from-green-500 { --tw-gradient-from: var(--green-500); }
.to-green-600 { --tw-gradient-to: #16a34a; }
.from-amber-500 { --tw-gradient-from: var(--amber-500); }
.to-amber-600 { --tw-gradient-to: #d97706; }

/* ═══════════════════════════════════════════════════════════
   COMPONENT STYLES — Clean Light
   ═══════════════════════════════════════════════════════════ */

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-primary);
}

/* ── Navigation Links ─────────────────────────────────────── */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}
.nav-link:hover {
    background: rgba(0,0,0,0.04);
    color: var(--text-primary);
}
.nav-link.active {
    background: rgba(56, 139, 253, 0.12);
    color: var(--blue-400);
    box-shadow: inset 3px 0 0 var(--blue-500);
}
.nav-link.active svg { color: var(--blue-400); }
.nav-link svg { flex-shrink: 0; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    border-color: var(--border-accent);
}
.card-body { padding: 1.25rem; }
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-primary);
    background: rgba(0,0,0,0.01);
}

/* ── Stat Cards — Premium with glow ──────────────────────── */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.25s ease;
}
.stat-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(to right, var(--stat-from), var(--stat-to));
}
/* Subtle radial glow behind icon */
.stat-card::after {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--stat-glow) 0%, transparent 70%);
    pointer-events: none;
}
.stat-card .stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-bright);
    letter-spacing: -0.02em;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.375rem;
    font-weight: 500;
}
.stat-card .stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-blue {
    --stat-from: var(--blue-500);
    --stat-to: var(--blue-600);
    --stat-glow: rgba(56, 139, 253, 0.08);
}
.stat-green {
    --stat-from: var(--green-400);
    --stat-to: var(--green-500);
    --stat-glow: rgba(63, 185, 80, 0.08);
}
.stat-purple {
    --stat-from: var(--purple-500);
    --stat-to: var(--purple-600);
    --stat-glow: rgba(163, 113, 247, 0.08);
}
.stat-amber {
    --stat-from: var(--amber-400);
    --stat-to: var(--amber-500);
    --stat-glow: rgba(210, 153, 34, 0.08);
}
.stat-blue .stat-icon { background: var(--glow-blue); color: var(--blue-400); }
.stat-green .stat-icon { background: var(--glow-green); color: var(--green-400); }
.stat-purple .stat-icon { background: var(--glow-purple); color: var(--purple-400); }
.stat-amber .stat-icon { background: var(--glow-amber); color: var(--amber-400); }

/* ── Status Badges ────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.badge-completed { background: var(--glow-green); color: var(--green-400); border: 1px solid rgba(63,185,80,0.2); }
.badge-processing, .badge-running { background: var(--glow-blue); color: var(--blue-400); border: 1px solid rgba(56,139,253,0.2); }
.badge-queued { background: rgba(139,148,158,0.1); color: var(--text-secondary); border: 1px solid rgba(139,148,158,0.15); }
.badge-failed { background: var(--glow-red); color: var(--red-400); border: 1px solid rgba(248,81,73,0.2); }
.badge-uploaded { background: var(--glow-purple); color: var(--purple-400); border: 1px solid rgba(163,113,247,0.2); }
.badge-valid { background: var(--glow-green); color: var(--green-400); border: 1px solid rgba(63,185,80,0.2); }
.badge-invalid { background: var(--glow-red); color: var(--red-400); border: 1px solid rgba(248,81,73,0.2); }
.badge-epub { background: var(--glow-blue); color: var(--blue-400); border: 1px solid rgba(56,139,253,0.2); }
.badge-docx { background: var(--glow-green); color: var(--green-400); border: 1px solid rgba(63,185,80,0.2); }
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.badge-valid::before, .badge-invalid::before, .badge-epub::before, .badge-docx::before { display: none; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.125rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--blue-600), var(--purple-600));
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(31, 111, 235, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(31, 111, 235, 0.45), inset 0 1px 0 rgba(255,255,255,0.15);
    transform: translateY(-1px);
}
.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}
.btn-secondary:hover {
    background: #e5e7eb;
    border-color: var(--border-accent);
}
.btn-danger {
    background: rgba(248,81,73,0.1);
    color: var(--red-400);
    border: 1px solid rgba(248,81,73,0.15);
}
.btn-danger:hover {
    background: rgba(248,81,73,0.18);
    border-color: rgba(248,81,73,0.3);
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: rgba(0,0,0,0.04); color: var(--text-primary); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(56,139,253,0.15);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}
.form-checkbox {
    width: 1rem; height: 1rem;
    accent-color: var(--blue-500);
    border-radius: 0.25rem;
    vertical-align: middle;
    margin-right: 0.5rem;
}
.form-error { color: var(--red-400); font-size: 0.8rem; margin-top: 0.25rem; }

/* ── Tables ───────────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    background: var(--bg-card);
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(0,0,0,0.02);
    border-bottom: 1px solid var(--border-primary);
}
.table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-primary);
    vertical-align: middle;
}
.table tbody tr { transition: background 0.1s ease; }
.table tbody tr:hover { background: rgba(0,0,0,0.02); }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-bar {
    height: 0.5rem;
    background: rgba(0,0,0,0.06);
    border-radius: 9999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--blue-500), var(--purple-500));
    border-radius: 9999px;
    transition: width 0.5s ease;
    box-shadow: 0 0 12px rgba(56,139,253,0.3);
}

/* ── Step Timeline ────────────────────────────────────────── */
.steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 1.5rem 0;
}
.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    position: relative;
}
.step::after {
    content: '';
    flex: 1;
    height: 2px;
    background: rgba(0,0,0,0.08);
}
.step:last-child::after { display: none; }
.step-dot {
    width: 2rem; height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid rgba(0,0,0,0.1);
    background: var(--bg-card);
    color: var(--text-muted);
}
.step.completed .step-dot {
    background: var(--green-500);
    border-color: var(--green-500);
    color: #fff;
    box-shadow: 0 0 12px rgba(63,185,80,0.3);
}
.step.active .step-dot {
    background: var(--blue-500);
    border-color: var(--blue-500);
    color: #fff;
    animation: pulse 2s infinite;
    box-shadow: 0 0 16px rgba(56,139,253,0.4);
}
.step.completed::after { background: var(--green-500); }
.step.active::after { background: linear-gradient(to right, var(--blue-500), rgba(0,0,0,0.08)); }
.step-label { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.step.completed .step-label { color: var(--green-400); }
.step.active .step-label { color: var(--blue-400); }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(56,139,253,0.5); }
    50% { box-shadow: 0 0 0 10px rgba(56,139,253,0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }

/* ── Upload Drop Zone ─────────────────────────────────────── */
.drop-zone {
    border: 2px dashed rgba(0,0,0,0.15);
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.25s ease;
    cursor: pointer;
    background: rgba(0,0,0,0.01);
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--blue-500);
    background: rgba(56,139,253,0.04);
    box-shadow: 0 0 30px rgba(56,139,253,0.08);
}
.drop-zone.has-file {
    border-color: var(--green-400);
    border-style: solid;
    background: rgba(63,185,80,0.04);
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}
.empty-state svg { margin: 0 auto 1rem; opacity: 0.2; }
.empty-state h3 { color: var(--text-primary); font-size: 1.125rem; font-weight: 600; }
.empty-state p { font-size: 0.875rem; margin-top: 0.5rem; color: var(--text-secondary); }

/* ── Auth Page ────────────────────────────────────────────── */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    padding: 2rem;
    /* Subtle background pattern */
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139,92,246,0.05) 0%, transparent 50%);
}
.auth-card {
    width: 100%;
    max-width: 26rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 25px 60px rgba(0,0,0,0.06), 0 0 0 1px var(--border-secondary);
}

/* ── Topbar ──────────────────────────────────────────────── */
header.sticky {
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-primary);
}

/* ── Flash Messages ──────────────────────────────────────── */
.flash-error { background: rgba(248,81,73,0.08); border: 1px solid rgba(248,81,73,0.15); color: var(--red-400); }
.flash-success { background: rgba(63,185,80,0.08); border: 1px solid rgba(63,185,80,0.15); color: var(--green-400); }
.flash-warning { background: rgba(210,153,34,0.08); border: 1px solid rgba(210,153,34,0.15); color: var(--amber-400); }
.flash-info { background: rgba(56,139,253,0.08); border: 1px solid rgba(56,139,253,0.15); color: var(--blue-400); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ══════════════════════════════════════════════════════════════ */

/* ── Mobile Sidebar Overlay ──────────────────────────────── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 25;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* ── Hamburger Button — hidden on desktop ─────────────────── */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 0.375rem;
    transition: background 0.15s ease;
    flex-shrink: 0;
}
.hamburger-btn:hover {
    background: rgba(0,0,0,0.05);
}

/* ── Topbar Inner Padding (desktop default) ──────────────── */
.topbar-inner {
    padding: 1rem 2rem;
}

/* ── Main content margin (desktop default) ────────────────── */
.main-content {
    margin-left: 16rem;
}

/* ── Main page content padding (desktop default) ──────────── */
.main-page-content {
    padding: 2rem;
}

/* ── Flash container padding (desktop default) ────────────── */
.flash-container {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* ── Upload button text ──────────────────────────────────── */
.upload-btn-text {
    display: inline;
}

/* ── Responsive Tables ───────────────────────────────────── */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Tablet — ≤1024px ────────────────────────────────────── */
@media (max-width: 1024px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }

    .main-page-content { padding: 1.5rem; }
    .topbar-inner { padding: 1rem 1.5rem; }
    .flash-container { padding-left: 1.5rem; padding-right: 1.5rem; }

    /* Step timeline labels smaller */
    .step-label { font-size: 0.65rem; }
}

/* ── Mobile — ≤768px ─────────────────────────────────────── */
@media (max-width: 768px) {
    /* Sidebar: off-screen overlay on mobile */
    .main-content { margin-left: 0; }
    .sidebar-nav { z-index: 30; }

    /* Show hamburger */
    .hamburger-btn { display: flex; }

    /* Reduce page padding */
    .main-page-content { padding: 1rem; }
    .topbar-inner { padding: 0.75rem 1rem; }
    .flash-container { padding-left: 1rem; padding-right: 1rem; }

    /* Grids go single column */
    .grid-cols-4, .grid-cols-3, .grid-cols-2 {
        grid-template-columns: repeat(1, 1fr);
    }

    /* Hide upload text on topbar button, keep icon */
    .upload-btn-text { display: none; }
    .upload-btn-topbar { padding: 0.5rem 0.625rem; }

    /* Cards less padding */
    .card-body { padding: 1rem; }
    .card-header { padding: 0.75rem 1rem; }

    /* Stat cards smaller text */
    .stat-card { padding: 1rem; }
    .stat-card .stat-value { font-size: 1.75rem; }
    .stat-card .stat-label { font-size: 0.75rem; }
    .stat-card .stat-icon { width: 2.25rem; height: 2.25rem; }

    /* Step timeline — compact */
    .steps { gap: 0; }
    .step-label { display: none; }
    .step-dot { width: 1.5rem; height: 1.5rem; font-size: 0.65rem; }

    /* Page title smaller */
    .topbar-inner h2 { font-size: 1.1rem; }
    .topbar-inner .text-sm { font-size: 0.75rem; }

    /* Tables: make scrollable */
    .table-container { border-radius: 0.5rem; }
    .table thead th { padding: 0.5rem 0.75rem; font-size: 0.6rem; }
    .table tbody td { padding: 0.5rem 0.75rem; font-size: 0.8rem; }

    /* Hide less important columns on mobile */
    .hidden-mobile { display: none !important; }

    /* Drop zone — less padding on mobile */
    .drop-zone { padding: 2rem 1rem; }

    /* Form grid on mobile = single column */
    .form-grid-responsive {
        grid-template-columns: 1fr !important;
    }

    /* Auth card less padding on mobile */
    .auth-card { padding: 1.5rem; margin: 0 0.5rem; }
    .auth-container { padding: 1rem; }

    /* Buttons stack vertically on small screens */
    .action-buttons-responsive {
        flex-direction: column;
        align-items: stretch !important;
    }
    .action-buttons-responsive .btn { justify-content: center; }

    /* Book detail flex layout stacks */
    .book-info-responsive {
        flex-direction: column;
        gap: 1rem !important;
    }

    /* Empty state less padding */
    .empty-state { padding: 2rem 1rem; }
    .empty-state svg { width: 3rem; height: 3rem; }

    /* Pre/code blocks word-break */
    pre { font-size: 0.7rem !important; padding: 0.75rem !important; }

    /* Validation messages table */
    .table td[style*="max-width"] { max-width: 100px !important; }

    /* Gap utilities reduced */
    .gap-5-responsive { gap: 0.75rem; }
    .gap-6-responsive { gap: 1rem; }

    /* Filter form */
    .filter-form-responsive {
        flex-direction: column;
    }
    .filter-form-responsive > * {
        min-width: 0 !important;
        width: 100%;
    }
}

/* ── Small Mobile — ≤480px ───────────────────────────────── */
@media (max-width: 480px) {
    .main-page-content { padding: 0.75rem; }
    .topbar-inner { padding: 0.625rem 0.75rem; }
    .topbar-inner h2 { font-size: 1rem; }
    .flash-container { padding-left: 0.75rem; padding-right: 0.75rem; }

    .stat-card .stat-value { font-size: 1.5rem; }
    .stat-card { padding: 0.875rem; }

    /* 2-col stat grid on very small screens */
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }

    .card-body { padding: 0.75rem; }
    .card-header { padding: 0.625rem 0.75rem; }

    .btn { font-size: 0.8rem; padding: 0.4rem 0.75rem; }
    .btn-lg { padding: 0.625rem 1rem; font-size: 0.875rem; }

    .badge { font-size: 0.6rem; padding: 0.2rem 0.5rem; }
}

/* ── Scrollbar Styling ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* ── Misc Sizes ───────────────────────────────────────────── */
.w-4 { width: 1rem; } .h-4 { height: 1rem; }
.w-5 { width: 1.25rem; } .h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; } .h-6 { height: 1.5rem; }
.w-8 { width: 2rem; } .h-8 { height: 2rem; }
.w-9 { width: 2.25rem; } .h-9 { height: 2.25rem; }
.w-10 { width: 2.5rem; } .h-10 { height: 2.5rem; }
.w-12 { width: 3rem; } .h-12 { height: 3rem; }
.w-16 { width: 4rem; } .h-16 { height: 4rem; }
.flex-shrink-0 { flex-shrink: 0; }

/* ── Inline style overrides for template compatibility ───── */
[style*="text-[10px]"], .text-\[10px\] { font-size: 10px !important; }
