/* =====================================================================
   DEINRIM WebList Pro — Design System
   Notion / Linear / Vercel inspired: minimal, rounded, glassmorphism,
   soft shadows, light + dark mode.
   ===================================================================== */

:root {
    --wl-bg: #f6f7f9;
    --wl-surface: #ffffff;
    --wl-surface-glass: rgba(255, 255, 255, 0.72);
    --wl-border: #e7e8ec;
    --wl-text: #1c1d21;
    --wl-text-muted: #6b6f76;
    --wl-primary: #5b5bf0;
    --wl-primary-hover: #4747d6;
    --wl-accent: #16b981;
    --wl-danger: #e5484d;
    --wl-warning: #f5a623;
    --wl-radius: 16px;
    --wl-radius-sm: 10px;
    --wl-shadow: 0 1px 2px rgba(16, 18, 27, 0.04), 0 8px 24px rgba(16, 18, 27, 0.06);
    --wl-shadow-lg: 0 4px 12px rgba(16, 18, 27, 0.06), 0 16px 40px rgba(16, 18, 27, 0.10);
    --wl-sidebar-w: 264px;

    /* Bridge Bootstrap's own color variables to ours. Bootstrap utilities like .text-body,
       .text-body-secondary, .border, .bg-body etc. read --bs-* variables that Bootstrap ships
       hardcoded for LIGHT mode only — they never track our [data-theme]/prefers-color-scheme
       dark mode on their own. Without this, dark-mode text using those utilities (e.g. a site
       card title with .text-body) renders as near-black text on a near-black card: invisible.
       Because these reference our --wl-* variables via var(), they automatically pick up the
       new values whenever the dark-mode blocks below override --wl-text/--wl-bg/etc. — no need
       to redeclare them per theme. */
    --bs-body-color: var(--wl-text);
    --bs-body-bg: var(--wl-bg);
    --bs-border-color: var(--wl-border);
    --bs-border-color-translucent: var(--wl-border);
    --bs-secondary-color: var(--wl-text-muted);
    --bs-tertiary-color: var(--wl-text-muted);
    --bs-emphasis-color: var(--wl-text);
    --bs-heading-color: var(--wl-text);
    --bs-link-color: var(--wl-primary);
    --bs-link-hover-color: var(--wl-primary-hover);
}

/* Bootstrap's .text-body utility specifically reads --bs-body-color-RGB (a comma-separated
   triplet consumed via rgba(var(...),1)), not the plain --bs-body-color above — overriding only
   the plain variable left .text-body still resolving to Bootstrap's hardcoded light-mode near-
   black. Overriding the class directly sidesteps that internal split entirely and stays correct
   even if Bootstrap's implementation changes. */
.text-body { color: var(--wl-text) !important; }

@media (prefers-color-scheme: dark) {
    :root {
        --wl-bg: #101114;
        --wl-surface: #17181c;
        --wl-surface-glass: rgba(24, 25, 29, 0.72);
        --wl-border: #2a2b31;
        --wl-text: #eceef1;
        --wl-text-muted: #9195a0;
        --wl-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
        --wl-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.35), 0 20px 48px rgba(0, 0, 0, 0.45);
    }
}
:root[data-theme="dark"] {
    --wl-bg: #101114;
    --wl-surface: #17181c;
    --wl-surface-glass: rgba(24, 25, 29, 0.72);
    --wl-border: #2a2b31;
    --wl-text: #eceef1;
    --wl-text-muted: #9195a0;
}
:root[data-theme="light"] {
    --wl-bg: #f6f7f9;
    --wl-surface: #ffffff;
    --wl-surface-glass: rgba(255, 255, 255, 0.72);
    --wl-border: #e7e8ec;
    --wl-text: #1c1d21;
    --wl-text-muted: #6b6f76;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
    background: var(--wl-bg);
    color: var(--wl-text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14.5px;
}
a { text-decoration: none; color: var(--wl-primary); }
::selection { background: var(--wl-primary); color: #fff; }

/* ---- Layout ---- */
.wl-app { display: flex; min-height: 100vh; }
.wl-sidebar {
    width: var(--wl-sidebar-w);
    flex-shrink: 0;
    background: var(--wl-surface);
    border-right: 1px solid var(--wl-border);
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
    z-index: 40;
    transition: transform .2s ease;
}
.wl-main { flex: 1; margin-left: var(--wl-sidebar-w); min-width: 0; }
.wl-topbar {
    position: sticky; top: 0; z-index: 30;
    background: var(--wl-surface-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--wl-border);
    padding: 14px 24px;
    display: flex; align-items: center; gap: 16px;
}
.wl-content { padding: 24px; max-width: 1400px; }

@media (max-width: 991px) {
    .wl-sidebar { transform: translateX(-100%); }
    .wl-sidebar.show { transform: translateX(0); }
    .wl-main { margin-left: 0; }
}

.wl-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; font-weight: 700; font-size: 1.05rem; }
.wl-brand .wl-logo-dot { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--wl-primary), #8b7bf7); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }

.wl-nav { padding: 8px 12px; }
.wl-nav-section { padding: 14px 10px 6px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--wl-text-muted); font-weight: 600; }
.wl-nav a.wl-nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--wl-radius-sm);
    color: var(--wl-text); font-size: 0.9rem; font-weight: 500;
    margin-bottom: 2px;
}
.wl-nav a.wl-nav-link i { font-size: 1rem; width: 18px; text-align: center; color: var(--wl-text-muted); }
.wl-nav a.wl-nav-link:hover { background: var(--wl-bg); }
.wl-nav a.wl-nav-link.active { background: color-mix(in srgb, var(--wl-primary) 12%, transparent); color: var(--wl-primary); }
.wl-nav a.wl-nav-link.active i { color: var(--wl-primary); }

/* ---- Cards ---- */
.wl-card {
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius);
    box-shadow: var(--wl-shadow);
}
.wl-glass {
    background: var(--wl-surface-glass);
    backdrop-filter: blur(14px);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius);
}
.wl-stat-card {
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius);
    padding: 18px 20px;
    box-shadow: var(--wl-shadow);
    display: flex; flex-direction: column; gap: 6px;
    transition: transform .15s ease, box-shadow .15s ease;
}
.wl-stat-card:hover { transform: translateY(-2px); box-shadow: var(--wl-shadow-lg); }
.wl-stat-card .wl-stat-icon {
    width: 38px; height: 38px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem; margin-bottom: 4px;
}
.wl-stat-card .wl-stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.wl-stat-card .wl-stat-label { color: var(--wl-text-muted); font-size: 0.82rem; }

/* ---- Website card ---- */
.wl-site-card {
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius);
    overflow: hidden;
    box-shadow: var(--wl-shadow);
    transition: transform .15s ease, box-shadow .15s ease;
    height: 100%;
    display: flex; flex-direction: column;
}
.wl-site-card:hover { transform: translateY(-3px); box-shadow: var(--wl-shadow-lg); }
.wl-site-shot { aspect-ratio: 16/10; background: var(--wl-bg); overflow: hidden; position: relative; }
.wl-site-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.wl-site-favicon { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; background: var(--wl-bg); }
.wl-site-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.wl-site-title { font-weight: 600; font-size: 0.95rem; margin: 0; }
.wl-site-desc { color: var(--wl-text-muted); font-size: 0.82rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Buttons ---- */
.btn-wl-primary {
    background: var(--wl-primary); border: none; color: #fff;
    border-radius: var(--wl-radius-sm); font-weight: 600; padding: 9px 18px;
}
.btn-wl-primary:hover { background: var(--wl-primary-hover); color: #fff; }
.btn-wl-soft { background: color-mix(in srgb, var(--wl-primary) 10%, transparent); color: var(--wl-primary); border: none; border-radius: var(--wl-radius-sm); font-weight: 600; }

.form-control, .form-select {
    background: var(--wl-surface); border: 1px solid var(--wl-border); color: var(--wl-text);
    border-radius: var(--wl-radius-sm); padding: 9px 12px;
}
.form-control:focus, .form-select:focus { border-color: var(--wl-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wl-primary) 18%, transparent); background: var(--wl-surface); color: var(--wl-text); }

.wl-auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--wl-bg); padding: 20px; }
.wl-auth-card { width: 100%; max-width: 420px; padding: 36px; }

.wl-install-wrap { min-height: 100vh; background: var(--wl-bg); padding: 40px 20px; }
.wl-install-card { max-width: 720px; margin: 0 auto; padding: 36px; }
.wl-step-indicator { display: flex; gap: 6px; margin-bottom: 28px; }
.wl-step-indicator span { flex: 1; height: 4px; border-radius: 4px; background: var(--wl-border); }
.wl-step-indicator span.done { background: var(--wl-accent); }
.wl-step-indicator span.active { background: var(--wl-primary); }

.wl-req-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--wl-border); }
.wl-req-row:last-child { border-bottom: none; }

.table { color: var(--wl-text); }
.table > :not(caption) > * > * { background: transparent; border-color: var(--wl-border); color: var(--wl-text); }

.badge { font-weight: 600; font-size: 0.72rem; padding: 5px 9px; border-radius: 7px; }
