:root {
    --bg: #080d16;
    --surface: #101826;
    --surface-2: #172132;
    --border: rgba(148, 163, 184, 0.16);
    --text: #f8fafc;
    --text-soft: #dbe4f0;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --placeholder: #94a3b8;
    --placeholder-focus: #cbd5e1;
    --primary: #38bdf8;
    --primary-hover: #7dd3fc;
    --primary-soft: rgba(56, 189, 248, 0.14);
    --ok: #34d399;
    --warn: #fbbf24;
    --danger: #f87171;
    --input-bg: #0c1422;
    --radius: 12px;
    --sidebar: 260px;
    --topbar: 64px;
    --font: Inter, "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
a.cp-btn:not(.cp-btn-ghost):not(.cp-btn-danger),
a.cp-btn:not(.cp-btn-ghost):not(.cp-btn-danger):hover { color: #0b1220; }
a.cp-btn-ghost,
a.cp-btn-ghost:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.cp-skip { position: absolute; left: -9999px; top: 0; z-index: 200; padding: 0.65rem 1rem; background: var(--surface); color: var(--text); font-weight: 600; }
.cp-skip:focus { left: 1rem; top: 1rem; }

.cp-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.cp-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; z-index: 40;
}
.cp-brand { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 0.65rem; color: var(--text); text-decoration: none; margin: 0; padding: 0.7rem 0.85rem; min-height: 84px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.cp-brand-mark, .cp-header-logo img { object-fit: contain; object-position: center; display: block; flex-shrink: 0; background: transparent; }
.cp-brand-mark { width: 72px; height: 72px; padding: 8px; box-sizing: border-box; }
.cp-brand-logo { width: 36px; height: 36px; object-fit: contain; object-position: center; }
.cp-header-logo { display: flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 0; width: 48px; height: 48px; }
.cp-header-logo img { width: 48px; height: 48px; padding: 6px; box-sizing: border-box; }
.cp-brand:hover { color: var(--text); }
.cp-mark { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #082032; font-weight: 800; flex-shrink: 0; }
.cp-brand-text { min-width: 0; }
.cp-brand strong { display: block; line-height: 1.15; letter-spacing: -0.02em; }
.cp-brand small { display: block; color: var(--text-muted); font-size: 0.72rem; }
.cp-side-workspace { flex-shrink: 0; padding: 0.65rem 0.8rem 0.7rem; border-bottom: 1px solid var(--border); }
.cp-side-workspace label { display: grid; gap: 0.28rem; color: var(--text-muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.cp-side-workspace select { width: 100%; min-height: 40px; background: var(--input-bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 0.55rem; }
.cp-sidebar ul { list-style: none; margin: 0; padding: 0; }
.cp-sidebar nav.scroll-region { overflow-y: auto; flex: 1; min-height: 0; padding: 0.5rem 0.5rem 0.8rem; -ms-overflow-style: none; scrollbar-width: none; }
.cp-sidebar nav.scroll-region::-webkit-scrollbar { display: none; }
.cp-nav-group { margin: 0 0 0.4rem; }
.cp-nav-group > span { display: block; padding: 0.4rem 0.6rem 0.18rem; color: var(--text-muted); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.cp-sidebar nav a { display: flex; align-items: center; gap: 0.6rem; color: var(--text-soft); text-decoration: none; padding: 0.45rem 0.6rem; border-radius: 8px; min-height: 42px; font-size: 0.92rem; }
.cp-sidebar nav a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-nav-ico { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted); }
.cp-sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
.cp-sidebar nav a:hover .cp-nav-ico { color: var(--text-soft); }
.cp-sidebar nav a[aria-current="page"] { background: var(--primary-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--primary); }
.cp-sidebar nav a.cp-nav-audit,
.cp-sidebar nav a.cp-nav-audit:hover,
.cp-sidebar nav a.cp-nav-audit[aria-current="page"] { background: #3d1518; color: #f8f4ec; font-weight: 700; box-shadow: inset 3px 0 0 #e24b4b; }
.cp-sidebar nav a.cp-nav-audit span,
.cp-sidebar nav a.cp-nav-audit:hover span,
.cp-sidebar nav a.cp-nav-audit[aria-current="page"] span,
.cp-sidebar nav a.cp-nav-audit .cp-nav-ico,
.cp-sidebar nav a.cp-nav-audit:hover .cp-nav-ico,
.cp-sidebar nav a.cp-nav-audit[aria-current="page"] .cp-nav-ico { color: #f8f4ec; }
.cp-sidebar nav a.cp-nav-policy,
.cp-sidebar nav a.cp-nav-policy:hover,
.cp-sidebar nav a.cp-nav-policy[aria-current="page"] { background: #0f6b66; color: #f4fffc; font-weight: 700; box-shadow: inset 3px 0 0 #7dfff4; }
.cp-sidebar nav a.cp-nav-policy span,
.cp-sidebar nav a.cp-nav-policy:hover span,
.cp-sidebar nav a.cp-nav-policy[aria-current="page"] span,
.cp-sidebar nav a.cp-nav-policy .cp-nav-ico,
.cp-sidebar nav a.cp-nav-policy:hover .cp-nav-ico,
.cp-sidebar nav a.cp-nav-policy[aria-current="page"] .cp-nav-ico { color: #f4fffc; }
.cp-sidebar nav a.cp-nav-framework,
.cp-sidebar nav a.cp-nav-framework:hover,
.cp-sidebar nav a.cp-nav-framework[aria-current="page"] { background: #ff7a00; color: #1a1208; font-weight: 700; box-shadow: inset 3px 0 0 #7a3200; }
.cp-sidebar nav a.cp-nav-framework span,
.cp-sidebar nav a.cp-nav-framework:hover span,
.cp-sidebar nav a.cp-nav-framework[aria-current="page"] span,
.cp-sidebar nav a.cp-nav-framework .cp-nav-ico,
.cp-sidebar nav a.cp-nav-framework:hover .cp-nav-ico,
.cp-sidebar nav a.cp-nav-framework[aria-current="page"] .cp-nav-ico { color: #1a1208; }
.cp-nav-count { margin-left: auto; min-width: 1.45rem; height: 1.35rem; padding: 0 0.35rem; border-radius: 999px; font-size: 0.72rem; font-weight: 800; line-height: 1.35rem; text-align: center; flex-shrink: 0; font-style: normal; }
.cp-sidebar nav a.cp-nav-audit .cp-nav-count { background: #f8f4ec; color: #3d1518; }
.cp-sidebar nav a.cp-nav-policy .cp-nav-count { background: #f4fffc; color: #0b3330; }
.cp-sidebar nav a.cp-nav-framework .cp-nav-count { background: #1a1208; color: #fff4e8; }
.cp-sidebar nav a.cp-nav-checklist,
.cp-sidebar nav a.cp-nav-checklist:hover,
.cp-sidebar nav a.cp-nav-checklist[aria-current="page"] { background: #1d4ed8; color: #f8fafc; font-weight: 700; box-shadow: inset 3px 0 0 #93c5fd; }
.cp-sidebar nav a.cp-nav-checklist span,
.cp-sidebar nav a.cp-nav-checklist:hover span,
.cp-sidebar nav a.cp-nav-checklist[aria-current="page"] span,
.cp-sidebar nav a.cp-nav-checklist .cp-nav-ico,
.cp-sidebar nav a.cp-nav-checklist:hover .cp-nav-ico,
.cp-sidebar nav a.cp-nav-checklist[aria-current="page"] .cp-nav-ico { color: #f8fafc; }
.cp-sidebar nav a.cp-nav-checklist .cp-nav-count { background: #f8fafc; color: #1e3a8a; }
.cp-sidebar nav a[aria-current="page"] .cp-nav-ico { color: var(--primary); }
.cp-side-foot { display: flex; align-items: center; gap: 0.55rem; padding: 0.65rem 0.8rem; border-top: 1px solid var(--border); min-width: 0; flex-shrink: 0; }
.cp-side-foot-text { min-width: 0; overflow: hidden; }
.cp-side-foot strong { display: block; font-size: 0.86rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-side-foot small { display: block; color: var(--text-muted); font-size: 0.72rem; }

.cp-maincol { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.cp-top {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 0.45rem 0.75rem; padding: 0 1rem 0 1.05rem; min-height: var(--topbar);
    border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; z-index: 20;
}
.cp-top-left, .cp-top-actions { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.cp-top-actions { flex-shrink: 0; }
.cp-top-title { min-width: 0; }
.cp-top h1 { margin: 0; font-size: 1.2rem; line-height: 1.2; letter-spacing: -0.03em; font-weight: 600; }
.cp-top .ee-marvis-summon { width: 36px; height: 36px; min-height: 36px; padding: 0; }
.cp-top .ee-marvis-logo--glow { animation: none; box-shadow: none; }
.cp-kicker { margin: 0; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.cp-search { position: relative; min-width: 0; flex: 1 1 12rem; max-width: 24rem; }
.cp-search-ico { position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%); display: flex; color: var(--text-muted); pointer-events: none; }
.cp-search-ico .cp-nav-ico { width: 15px; height: 15px; }
.cp-search input { width: 100%; min-height: 38px; border: 1px solid var(--border); border-radius: 999px; background: var(--input-bg); color: var(--text); padding: 0.35rem 0.8rem 0.35rem 2.1rem; }
.cp-search input::placeholder { color: var(--placeholder); }
.cp-iconbtn {
    display: none; width: 42px; min-height: 42px; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; padding: 0;
}
.cp-iconbtn .cp-nav-ico { width: 16px; height: 16px; color: var(--text-soft); }
.cp-btn-sm { min-height: 38px; padding: 0.35rem 0.8rem; font-size: 0.88rem; }
.cp-btn-new { gap: 0.35rem; display: inline-flex; align-items: center; }
.cp-btn-plus { font-size: 1.1rem; line-height: 1; font-weight: 700; }
.cp-top-user { position: relative; flex-shrink: 0; }
.cp-user-btn {
    display: flex; align-items: center; gap: 0.45rem; min-height: 38px;
    padding: 0.15rem 0.5rem 0.15rem 0.2rem; border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface-2); color: var(--text); cursor: pointer;
}
.cp-avatar { width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); font-size: 0.72rem; font-weight: 700; flex-shrink: 0; }
.cp-who { color: var(--text-soft); font-size: 0.86rem; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-user-menu { position: absolute; right: 0; top: calc(100% + 0.4rem); min-width: 12.5rem; padding: 0.65rem 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); z-index: 30; }
.cp-user-name { margin: 0; font-weight: 650; }
.cp-clock { color: var(--text-muted); font-size: 0.8rem; margin: 0.15rem 0 0.55rem; }
.cp-user-menu a { display: flex; align-items: center; min-height: 40px; }
.cp-user-menu form { margin: 0; }
.cp-menu-btn {
    display: flex; align-items: center; width: 100%; min-height: 44px;
    padding: 0; border: 0; background: transparent; color: var(--text);
    font: inherit; text-align: left; cursor: pointer;
}
.cp-menu-btn:hover { color: var(--primary); }

.cp-scroll { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.cp-content { padding: 1.25rem 1.35rem 5.5rem; max-width: 1180px; width: 100%; margin: 0 auto; }
.cp-content-wide { max-width: 1480px; }
.cp-foot { border-top: 1px solid var(--border); background: var(--surface); padding: 0.4rem 1.1rem; }
.cp-foot nav { display: flex; flex-wrap: wrap; gap: 0.1rem 1rem; align-items: center; max-width: 1480px; margin: 0 auto; }
.cp-foot a { min-height: 36px; display: inline-flex; align-items: center; color: var(--text-muted); text-decoration: none; font-size: 0.86rem; }
.cp-foot a:hover { color: var(--text); }
.cp-burger { display: none; width: 42px; min-height: 42px; flex-direction: column; justify-content: center; gap: 5px; background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 0.45rem; cursor: pointer; }
.cp-burger span { display: block; height: 2px; background: var(--text); }
.cp-overlay { display: none; }

@media (min-width: 1200px) {
    .cp-shell { grid-template-columns: 264px minmax(0, 1fr); }
    .cp-search { flex: 1 1 16rem; max-width: 28rem; }
    .cp-content { padding: 1.35rem 1.75rem 5.5rem; }
    .cp-who { max-width: 12rem; }
}
@media (min-width: 768px) and (max-width: 1099px) {
    .cp-shell { grid-template-columns: 216px minmax(0, 1fr); }
    .cp-search { flex: 1 1 10rem; max-width: 16rem; }
    .cp-who, .cp-btn-label { display: none; }
    .cp-btn-new { min-width: 38px; padding: 0.35rem 0.55rem; justify-content: center; }
}
@media (max-width: 767px) {
    .cp-shell { grid-template-columns: minmax(0, 1fr); }
    .cp-burger, .cp-iconbtn { display: flex; }
    .cp-kicker, .cp-who, .cp-btn-label, .cp-foot, .cp-header-logo { display: none; }
    .cp-top {
        position: sticky;
        top: 0;
        padding: 0.4rem 0.75rem;
        padding-top: max(0.4rem, env(safe-area-inset-top));
        z-index: 50;
        gap: 0.45rem;
        border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.1));
        background: color-mix(in srgb, var(--surface, #0f1419) 94%, transparent);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    .cp-top-left { flex: 1 1 auto; min-width: 0; gap: 0.45rem; }
    .cp-top-title { min-width: 0; flex: 1 1 auto; }
    .cp-top-actions { flex: 0 0 auto; justify-content: flex-end; gap: 0.3rem; }
    .cp-top h1 {
        font-size: 1.05rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: min(52vw, 14rem);
    }
    .cp-burger {
        min-width: 44px;
        min-height: 44px;
        flex: 0 0 auto;
    }
    .cp-search {
        display: none;
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
        order: 5;
        padding: 0 0 0.15rem;
    }
    .cp-shell.search-open .cp-search { display: block; }
    .cp-shell.search-open .cp-iconbtn { background: var(--primary-soft); border-color: transparent; }
    .cp-btn-new { min-width: 44px; min-height: 44px; padding: 0; justify-content: center; }
    .cp-user-btn { padding: 0.1rem; min-height: 44px; min-width: 44px; justify-content: center; }
    .cp-iconbtn { min-width: 44px; min-height: 44px; }
    .cp-content {
        padding: 0.75rem 0.7rem calc(5.5rem + env(safe-area-inset-bottom));
        overflow-x: clip;
        min-width: 0;
    }
    .cp-content > * { min-width: 0; max-width: 100%; }
    .cp-sidebar {
        position: fixed; left: 0; top: 0; width: min(var(--sidebar), 88vw); max-width: 88vw;
        height: 100vh; height: 100dvh; padding-top: env(safe-area-inset-top);
        transform: translate3d(-110%, 0, 0); transition: transform 0.2s ease, visibility 0.2s ease;
        visibility: hidden; pointer-events: none; box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
        z-index: 40;
    }
    .cp-sidebar nav a { min-height: 44px; }
    .cp-shell.nav-open .cp-sidebar { transform: none; visibility: visible; pointer-events: auto; }
    .cp-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 30; display: none; }
    .cp-shell.nav-open .cp-overlay { display: block; }
    body.cp-nav-open { overflow: hidden; }
}
