/* Generated from app.css by tools/core-migration/build_styles.py. */

@layer core-legacy {
:root {

    --bg-0: #0D0B1F;
    --bg-1: #0E0C1F;
    --bg-2: #141230;
    --bg-3: #1B1840;
    --bg-4: #252050;


    --border:    rgba(175, 169, 236, 0.09);
    --border-2:  rgba(175, 169, 236, 0.18);
    --border-3:  rgba(175, 169, 236, 0.28);


    --brand:     #534AB7;
    --brand-2:   #3D3593;
    --brand-soft: #6B62D4;


    --accent:    #534ab7;
    --accent-d:  #443b9b;


    --ok:        #A78BFA;
    --warn:      #FFB84D;
    --err:       #FF6B78;
    --gold:      #FFD166;


    --text-0:    #F0EFFC;
    --text-1:    #AFA9EC;
    --text-2:    #9892D8;
    --text-3:    #8076BC;


    --hrs-purple-300: var(--p5);
    --hrs-purple-500: var(--p3);
    --hrs-purple-700: var(--brand-2);
    --accent-0:       var(--brand-2);
    --accent-1:       var(--p3);
    --accent-2:       var(--p5);



    --font-ui:      'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono:    var(--hc-font);
    --font-sans:    var(--font-ui);
    --font-display: var(--font-ui);


    --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
    --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;
    --s-9: 48px; --s-10: 64px; --s-11: 80px;


    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;


    --shadow-1: 0 1px 0 rgba(255,255,255,0.02), 0 4px 16px rgba(0,0,0,0.20);
    --shadow-2: 0 1px 0 rgba(255,255,255,0.02), 0 8px 32px rgba(0,0,0,0.40);


    --sidebar-w: 248px;
    --topbar-h:  64px;
}


html[data-theme="light"] {
    --bg-0: #F4F2FC;
    --bg-1: #FFFFFF;
    --bg-2: #F7F6FF;
    --bg-3: #EFEDFB;
    --bg-4: #E6E2F7;

    --border:   rgba(83,74,183,0.12);
    --border-2: rgba(83,74,183,0.20);
    --border-3: rgba(83,74,183,0.30);

    --text-0: #16123A;
    --text-1: #2A2458;
    --text-2: #534AB7;
    --text-3: #6B659A;

    --accent:   #534AB7;
    --accent-d: #3D3593;

    --shadow-1: 0 1px 0 rgba(83,74,183,0.04), 0 4px 16px rgba(83,74,183,0.08);
    --shadow-2: 0 1px 0 rgba(83,74,183,0.04), 0 8px 32px rgba(83,74,183,0.14);
}


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--font-ui);
    font-weight: 500;
    color: var(--text-0);
    background: var(--bg-0);
    font-size: 14px;
    line-height: 1.5;
    font-optical-sizing: auto;
    font-feature-settings: "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}


h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-ui);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -0.022em;
    color: var(--text-0);
}
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.032em; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; font-weight: 650; }

a { color: var(--brand-soft); text-decoration: none; transition: color 0.12s; }
a:hover { color: var(--text-0); }

code, pre, .mono { font-family: var(--font-mono); font-feature-settings: "ss01", "ss02"; }



.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}
.sidebar {
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    padding: var(--s-6) 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    padding: 0 var(--s-6) var(--s-6);
    display: flex;
    align-items: center;
    gap: var(--s-3);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--s-4);
}
.sidebar-brand .logo {
    width: 28px;
    height: 28px;
    background: var(--brand);
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--bg-0);
    font-size: 13px;
    letter-spacing: -0.04em;
}
.sidebar-brand .name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
}
.sidebar-brand .tag {
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.nav { padding: 0 var(--s-3); flex: 1; }
.nav-section {
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: var(--s-4) var(--s-3) var(--s-2);
}
.nav a {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-sm);
    color: var(--text-1);
    font-weight: 500;
    font-size: 13.5px;
    transition: background 0.12s, color 0.12s;
}
.nav a:hover { background: var(--bg-2); color: var(--text-0); }
.nav a.active {
    background: var(--bg-3);
    color: var(--text-0);
    font-weight: 600;
}
.nav a.active::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
    margin-left: -11px;
    margin-right: 8px;
}
.nav .icon { width: 16px; height: 16px; opacity: 0.8; flex-shrink: 0; }

.sidebar-foot {
    padding: var(--s-4) var(--s-6);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--s-3);
}
.sidebar-foot .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-0);
}
.sidebar-foot .who-name { font-weight: 600; font-size: 13px; }
.sidebar-foot .who-role { font-size: 13px; color: var(--text-2); font-family: var(--font-mono); }


.main { display: flex; flex-direction: column; }
.topbar {
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--s-7);
    background: rgba(7, 6, 15, 0.7);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar h1, .topbar .topbar-title { font-size: 18px; font-weight: 600; color: var(--text-0); }
.topbar .actions { display: flex; gap: var(--s-3); }

.page { padding: var(--s-7); max-width: none; }
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--s-7);
    gap: var(--s-6);
}
.page-header h1 { margin-bottom: var(--s-2); }
.page-header .subtitle { color: var(--text-1); font-size: 14px; }



.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-6);
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--s-4);
    margin-bottom: var(--s-4);
    border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 14px; font-weight: 600; }
.card-head .label {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}


.stat {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-6);
    position: relative;
    overflow: hidden;
}
.stat-label {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--s-3);
}
.stat-value {
    font-family: var(--font-mono);
    font-size: 36px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-0);
}
.stat-unit { font-size: 16px; color: var(--text-2); margin-left: 4px; }
.stat-delta {
    font-family: var(--font-mono);
    font-size: 13px;
    margin-top: var(--s-3);
}
.stat-delta.up   { color: var(--ok); }
.stat-delta.down { color: var(--err); }
.stat-delta.flat { color: var(--text-2); }
.stat-spark {
    position: absolute;
    right: var(--s-4);
    bottom: var(--s-4);
    opacity: 0.4;
    pointer-events: none;
}


.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); margin-bottom: var(--s-7); }
.grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
.grid-3     { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); }
@media (max-width: 1100px) { .grid-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .grid-stats, .grid-2, .grid-3 { grid-template-columns: 1fr; } }


.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size:14px;
}
table.data th {
    text-align: left;
    padding: var(--s-3) var(--s-5);
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-2);
    font-weight: 500;
}
table.data td {
    padding: var(--s-3) var(--s-5);
    border-bottom: 1px solid var(--border);
    color: var(--text-1);
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--bg-3); color: var(--text-0); }
table.data td.num { font-family: var(--font-mono); }



.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: 0 var(--s-4);
    height: 36px;
    border-radius: var(--r-sm);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, transform 0.06s;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--accent);
    color:var(--hc-on-action);
    border-color: var(--accent-d);
}
.btn-primary:hover { background: var(--accent-d); color:var(--hc-on-action); }
.btn-secondary {
    background: var(--bg-3);
    color: var(--text-0);
    border-color: var(--border-2);
}
.btn-secondary:hover { background: var(--bg-4); border-color: var(--border-3); }
.btn-ghost { background: transparent; color: var(--text-1); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text-0); }
.btn-danger {
    background: transparent;
    color: var(--err);
    border-color: rgba(255,107,120,0.3);
}
.btn-danger:hover { background: rgba(255,107,120,0.1); }
.btn-sm { height: 28px; padding: 0 var(--s-3); font-size: 13px; }
.btn-lg { height: 44px; padding: 0 var(--s-6); font-size: 14px; }



.field { margin-bottom: var(--s-5); }
.field label, label.field-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-2);
    margin-bottom: var(--s-2);
    font-weight: 500;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], textarea, select {
    width: 100%;
    background: var(--bg-1);
    border: 1px solid var(--border-2);
    color: var(--text-0);
    padding: 10px 12px;
    border-radius: var(--r-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.12s, background 0.12s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--bg-2);
}
input::placeholder { color: var(--text-3); }
textarea { resize: vertical; min-height: 80px; }
.help { font-size:14px; color: var(--text-2); margin-top: var(--s-2); }



.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg-3);
    color: var(--text-1);
    border: 1px solid var(--border);
}
.chip-ok    { background: rgba(167,139,250,0.10); color: var(--ok); border-color: rgba(167,139,250,0.20); }
.chip-warn  { background: rgba(255,184,77,0.10); color: var(--warn); border-color: rgba(255,184,77,0.20); }
.chip-err   { background: rgba(255,107,120,0.10); color: var(--err); border-color: rgba(255,107,120,0.20); }
.chip-brand { background: rgba(104,96,224,0.12); color: var(--brand-soft); border-color: rgba(104,96,224,0.25); }


.risk-bar { display: flex; align-items: center; gap: var(--s-3); }
.risk-bar .track {
    height: 6px;
    background: var(--bg-1);
    border-radius: 3px;
    flex: 1;
    overflow: hidden;
    position: relative;
}
.risk-bar .fill {
    position: absolute;
    inset: 0 auto 0 0;
    background: var(--brand);
    border-radius: 3px;
}
.risk-bar.low      .fill { background: var(--ok); }
.risk-bar.moderate .fill { background: var(--accent); }
.risk-bar.elevated .fill { background: var(--warn); }
.risk-bar.high     .fill { background: var(--err); }
.risk-bar .num { font-family: var(--font-mono); font-size: 13px; color: var(--text-1); min-width: 28px; text-align: right; }


.flash {
    padding: var(--s-4) var(--s-5);
    border-radius: var(--r-md);
    margin-bottom: var(--s-5);
    border: 1px solid;
    font-size:14px;
}
.flash-ok    { background: rgba(167,139,250,0.06); border-color: rgba(167,139,250,0.20); color: var(--ok); }
.flash-warn  { background: rgba(255,184,77,0.06); border-color: rgba(255,184,77,0.20); color: var(--warn); }
.flash-err   { background: rgba(255,107,120,0.06); border-color: rgba(255,107,120,0.20); color: var(--err); }


.empty {
    text-align: center;
    padding: var(--s-10) var(--s-6);
    color: var(--text-2);
}
.empty h3 { color: var(--text-1); margin-bottom: var(--s-2); }
.empty p  { font-size:14px; }



.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: var(--s-6);
    position: relative;

    background: var(--bg-0);
}
.login-card {
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-radius: var(--r-xl);
    padding: var(--s-9) var(--s-8);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-2);
}
.login-brand {
    text-align: center;
    margin-bottom: var(--s-7);
}
.login-brand .logo {
    width: 48px;
    height: 48px;
    background: var(--brand);
    border-radius: var(--r-md);
    display: inline-grid;
    place-items: center;
    font-weight: 800;
    color: var(--bg-0);
    font-size: 22px;
    letter-spacing: -0.04em;
    margin-bottom: var(--s-4);
}
.login-brand h1 { font-size: 22px; margin-bottom: var(--s-1); }
.login-brand p { font-size: 13px; color: var(--text-2); font-family: var(--font-mono); letter-spacing: 0.04em; }


.u-mono   { font-family: var(--font-mono); }
.u-mt-4   { margin-top: var(--s-4); }
.u-mt-5   { margin-top: var(--s-5); }
.u-mt-6   { margin-top: var(--s-6); }
.u-mt-7   { margin-top: var(--s-7); }
.u-mb-4   { margin-bottom: var(--s-4); }
.u-mb-5   { margin-bottom: var(--s-5); }
.u-mb-6   { margin-bottom: var(--s-6); }
.u-flex   { display: flex; }
.u-gap-2  { gap: var(--s-2); }
.u-gap-3  { gap: var(--s-3); }
.u-gap-4  { gap: var(--s-4); }
.u-grow   { flex: 1; }
.u-text-2 { color: var(--text-2); }
.u-text-1 { color: var(--text-1); }
.u-center { text-align: center; }


.page > * { animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.page > *:nth-child(1) { animation-delay: 0ms; }
.page > *:nth-child(2) { animation-delay: 40ms; }
.page > *:nth-child(3) { animation-delay: 80ms; }
.page > *:nth-child(4) { animation-delay: 120ms; }
@keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}




:root{
    --hrs-tap: 44px;
    --hrs-bottombar-h: 64px;
    --hrs-drawer-w: 84vw;
    --hrs-safe-b: env(safe-area-inset-bottom, 0px);
    --hrs-safe-t: env(safe-area-inset-top, 0px);
}


.app     { min-height: 100dvh; }
.sidebar { height: 100dvh; }


.hrs-navtoggle { display: none; }
.hrs-scrim     { display: none; }
.hrs-bottombar { display: none; }


.hrs-icon-btn{
    width: var(--hrs-tap); height: var(--hrs-tap); min-width: var(--hrs-tap);
    display: inline-grid; place-items: center;
    border-radius: var(--r-md); border: 1px solid var(--border-2);
    background: var(--bg-2); color: var(--text-1); cursor: pointer;
    flex-shrink: 0;
}
.hrs-icon-btn:active { transform: translateY(1px); }
.hrs-icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }


@media (max-width: 860px){


    .app { grid-template-columns: 1fr; }


    .sidebar{
        position: fixed; inset: 0 auto 0 0;
        width: var(--hrs-drawer-w); max-width: 340px;
        transform: translateX(-102%);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
        box-shadow: var(--shadow-2);
        padding-top: max(var(--s-6), var(--hrs-safe-t));
        z-index: 60; will-change: transform;
    }
    body.hrs-drawer-open .sidebar { transform: translateX(0); }


    .hrs-scrim{
        display: block; position: fixed; inset: 0; z-index: 55;
        background: rgba(7,6,15,.6); backdrop-filter: blur(2px);
        opacity: 0; pointer-events: none; transition: opacity .28s ease;
    }
    body.hrs-drawer-open .hrs-scrim { opacity: 1; pointer-events: auto; }
    body.hrs-drawer-open { overflow: hidden; }


    .topbar{
        padding: 0 var(--s-4);
        padding-top: var(--hrs-safe-t);
        height: calc(var(--topbar-h) + var(--hrs-safe-t));
        gap: var(--s-2);
    }
    .hrs-navtoggle { display: inline-grid; }
    .topbar h1,
    .topbar .topbar-title{
        font-size: 17px; flex: 1; text-align: center;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }

    .topbar .actions .btn,
    .topbar .actions .select,
    .topbar .actions select { display: none; }
    .topbar .actions { gap: var(--s-1); }


    .page{
        padding: var(--s-4);
        padding-bottom: calc(var(--hrs-bottombar-h) + var(--hrs-safe-b) + var(--s-5));
        max-width: 100%;
    }
    .page-header{ flex-direction: column; gap: var(--s-4); }


    .hrs-bottombar{
        display: grid; grid-template-columns: repeat(5, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
        height: calc(var(--hrs-bottombar-h) + var(--hrs-safe-b));
        padding-bottom: var(--hrs-safe-b);
        background: rgba(14,12,31,.86); backdrop-filter: blur(16px);
        border-top: 1px solid var(--border);
    }
    .hrs-bottombar a{
        display: flex; flex-direction: column; align-items: center;
        justify-content: center; gap: 3px;
        min-height: var(--hrs-tap); position: relative;
        color: var(--text-3); font-size: 13px; font-weight: 600;
        letter-spacing: .01em; text-decoration: none;
    }
    .hrs-bottombar a .ic{ width: 22px; height: 22px; opacity: 1; }
    .hrs-bottombar a:active{ background: var(--bg-2); }
    .hrs-bottombar a.active{ color: var(--accent); }
    .hrs-bottombar a.active::after{
        content: ''; position: absolute; top: 6px;
        width: 20px; height: 2px; border-radius: 2px;
        background: var(--accent); box-shadow: 0 0 8px var(--accent);
    }
}


@media (max-width: 380px){
    .hrs-bottombar a { font-size: 13px; }
    .hrs-bottombar a .ic { width: 20px; height: 20px; }
}


@media (prefers-reduced-motion: reduce){
    .sidebar, .hrs-scrim { transition: none; }
}
}
