/* =====================================================================
   Alterplex Scraper — UI theme
   Clean, professional look layered over Bootstrap 5 (not the default skin)
   ===================================================================== */

:root {
    --ax-bg: #0f172a;          /* slate-900  */
    --ax-bg-2: #1e293b;        /* slate-800  */
    --ax-surface: #ffffff;
    --ax-border: #e2e8f0;
    --ax-text: #0f172a;
    --ax-muted: #64748b;
    --ax-primary: #4f46e5;     /* indigo-600 */
    --ax-primary-600: #4338ca;
    --ax-accent: #06b6d4;      /* cyan-500   */
    --ax-radius: 14px;
    --ax-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
}

body {
    background: #f1f5f9;
    color: var(--ax-text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Auth (login) ---------- */
.ax-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(79, 70, 229, .35), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(6, 182, 212, .30), transparent 55%),
        var(--ax-bg);
    padding: 1.5rem;
}
.ax-auth-card {
    width: 100%;
    max-width: 410px;
    background: var(--ax-surface);
    border-radius: var(--ax-radius);
    box-shadow: 0 20px 60px rgba(2, 6, 23, .45);
    padding: 2.25rem;
}
.ax-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    letter-spacing: -.02em;
}
.ax-brand .dot {
    width: 14px; height: 14px; border-radius: 50%;
    background: linear-gradient(135deg, var(--ax-primary), var(--ax-accent));
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .15);
}

/* ---------- Admin shell ---------- */
.ax-shell { display: flex; min-height: 100vh; }
.ax-sidebar {
    width: 250px;
    flex: 0 0 250px;
    background: var(--ax-bg);
    color: #cbd5e1;
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
}
.ax-sidebar .ax-brand { color: #fff; padding: .35rem .5rem 1.25rem; }
.ax-nav { list-style: none; margin: 0; padding: 0; }
.ax-nav a {
    display: flex; align-items: center; gap: .65rem;
    padding: .62rem .75rem;
    margin-bottom: .15rem;
    color: #cbd5e1;
    border-radius: 10px;
    text-decoration: none;
    font-size: .94rem;
    transition: background .15s, color .15s;
}
.ax-nav a:hover { background: var(--ax-bg-2); color: #fff; }
.ax-nav a.active {
    background: linear-gradient(135deg, var(--ax-primary), var(--ax-primary-600));
    color: #fff;
    box-shadow: 0 6px 18px rgba(79, 70, 229, .35);
}
.ax-nav .ax-nav-section {
    text-transform: uppercase;
    font-size: .68rem;
    letter-spacing: .08em;
    color: #64748b;
    padding: 1rem .75rem .35rem;
}

.ax-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ax-topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--ax-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky; top: 0; z-index: 10;
}
.ax-content { padding: 1.75rem; flex: 1 1 auto; }

/* ---------- Cards / stats ---------- */
.ax-card {
    background: var(--ax-surface);
    border: 1px solid var(--ax-border);
    border-radius: var(--ax-radius);
    box-shadow: var(--ax-shadow);
}
.ax-stat { padding: 1.15rem 1.25rem; }
.ax-stat .label { color: var(--ax-muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ax-stat .value { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.ax-stat .icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.2rem;
    background: rgba(79, 70, 229, .1); color: var(--ax-primary);
}

/* ---------- Status badges ---------- */
.badge-status { font-weight: 600; padding: .35em .6em; border-radius: 8px; }
.status-detected          { background: #e0e7ff; color: #3730a3; }
.status-processing        { background: #fef3c7; color: #92400e; }
.status-extracted         { background: #dcfce7; color: #166534; }
.status-failed            { background: #fee2e2; color: #991b1b; }
.status-skipped_duplicate { background: #f1f5f9; color: #475569; }

.level-info    { color: #2563eb; }
.level-warning { color: #d97706; }
.level-error   { color: #dc2626; }

/* ---------- Empty states ---------- */
.ax-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ax-muted);
}
.ax-empty .emoji { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .8; }

/* ---------- Wizard steps ---------- */
.ax-step {
    display: inline-flex; align-items: center; gap: .4rem;
    font-weight: 600; font-size: .9rem; color: var(--ax-muted);
    padding: .25rem .6rem; border-radius: 999px;
}
.ax-step .n {
    width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center; font-size: .8rem;
    background: var(--ax-border); color: var(--ax-muted);
}
.ax-step.active { color: var(--ax-primary); background: rgba(79,70,229,.08); }
.ax-step.active .n { background: var(--ax-primary); color: #fff; }
.ax-step.done .n { background: #16a34a; color: #fff; }

/* ---------- Misc ---------- */
.btn-primary { background: var(--ax-primary); border-color: var(--ax-primary); }
.btn-primary:hover { background: var(--ax-primary-600); border-color: var(--ax-primary-600); }
a { color: var(--ax-primary); }
.text-muted-2 { color: var(--ax-muted) !important; }

@media (max-width: 768px) {
    .ax-sidebar { position: fixed; left: -260px; z-index: 1050; transition: left .2s; }
    .ax-sidebar.open { left: 0; }
}
