:root {
    --wm-primary: #1b66c9;
    --wm-primary-dark: #14509f;
    --wm-bg: #f4f6fb;
    --wm-sidebar: #ffffff;
    --wm-border: #e3e8f0;
    --wm-text: #1f2937;
    --wm-muted: #6b7280;
    --sidebar-w: 256px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--wm-bg);
    color: var(--wm-text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 15px;
}

/* ---- Shell ---- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--wm-sidebar);
    border-right: 1px solid var(--wm-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 1040;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--wm-border);
}
.sidebar-brand i { font-size: 1.7rem; color: var(--wm-primary); }
.brand-title { font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.brand-sub { font-size: .78rem; color: var(--wm-muted); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem .6rem; }
.sidebar-nav .nav-link,
.sidebar-footer .nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .8rem;
    border-radius: .55rem;
    color: var(--wm-text);
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 2px;
}
.sidebar-nav .nav-link i { font-size: 1.1rem; width: 1.3rem; text-align: center; }
.sidebar-nav .nav-link:hover { background: #eef3fb; color: var(--wm-primary-dark); }
.sidebar-nav .nav-link.active {
    background: var(--wm-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(27,102,201,.3);
}
.sidebar-footer { padding: .75rem .6rem; border-top: 1px solid var(--wm-border); }
.sidebar-footer .nav-link:hover { background: #fdeaea; }

/* ---- Main ---- */
.main-area {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--wm-border);
    position: sticky;
    top: 0;
    z-index: 1020;
}
.topbar-title { font-size: 1.25rem; font-weight: 700; margin: 0; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }

.content { padding: 1.5rem; max-width: 1500px; width: 100%; }

/* ---- Cards ---- */
.card { border: 1px solid var(--wm-border); border-radius: .75rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--wm-border); font-weight: 600; }

.stat-card { border-radius: .75rem; padding: 1.1rem 1.25rem; background: #fff; border: 1px solid var(--wm-border); height: 100%; }
.stat-card .stat-label { color: var(--wm-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-icon { font-size: 1.6rem; opacity: .85; }

/* ---- Tip cards ---- */
.tip-card { border-radius: .8rem; border: 1px solid var(--wm-border); background: #fff; }
.tip-card .tip-score {
    font-size: 2rem; font-weight: 800; letter-spacing: .04em;
    color: var(--wm-primary-dark);
}
.tip-prob-bar { height: 8px; border-radius: 4px; overflow: hidden; display: flex; background: #eef1f6; }
.tip-prob-bar > span { display: block; height: 100%; }

.prob-home { background: #2e7d32; }
.prob-draw { background: #f9a825; }
.prob-away { background: #c62828; }

/* ---- Tables ---- */
.table thead th { background: #f8fafc; font-size: .82rem; text-transform: uppercase; letter-spacing: .02em; color: var(--wm-muted); }
.table-hover tbody tr:hover { background: #f5f8fe; }

/* ---- Misc ---- */
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.help-text { font-size: .82rem; color: var(--wm-muted); }
code, pre { font-size: .85rem; }
pre.json-view { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: .6rem; overflow:auto; max-height: 480px; }

.sidebar-backdrop { display: none; }

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-area { margin-left: 0; }
    .sidebar-backdrop.show {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1035;
    }
}
