:root {
    --blue: #1d4ed8;
    --blue-deep: #1e40af;
    --ink: #0f2748;
    --muted: #64748b;
    --line: #e6edf5;
    --bg: #f4f7fb;
    --card: #ffffff;
    --ok: #047857;
    --warn: #b45309;
    --danger: #be123c;
    --shadow: 0 10px 30px rgba(15, 39, 72, 0.08);
    --nav: 4.6rem;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
    min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.ico { width: 1.55rem; height: 1.55rem; display: block; }

.desk {
    display: none;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(circle at top, rgba(29, 78, 216, 0.35), transparent 46%),
        #0b1b3a;
    color: #fff;
}
.desk-card {
    width: min(26rem, 100%);
    text-align: center;
}
.desk-phone {
    width: 7.5rem;
    height: 7.5rem;
    margin: 0 auto 1.2rem;
    border-radius: 1.6rem;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
}
.desk h1 { margin: 0 0 .4rem; font-size: 1.7rem; }
.desk p { margin: 0; color: rgba(255, 255, 255, 0.78); line-height: 1.5; }
html.is-desktop .shell,
html.is-desktop .face { display: none !important; }
html.is-desktop .desk { display: flex; }

.shell { min-height: 100dvh; padding-bottom: calc(var(--nav) + var(--safe-b)); }
.top {
    background: linear-gradient(180deg, var(--blue) 0%, var(--blue-deep) 100%);
    color: #fff;
    padding: calc(.9rem + var(--safe-t)) 1.1rem 2.4rem;
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.top h1 { margin: 0; font-size: 1.35rem; font-weight: 650; letter-spacing: -0.02em; }
.top p { margin: .15rem 0 0; font-size: .82rem; color: rgba(255, 255, 255, 0.78); }
.ghost {
    border: 0;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: .8rem;
    display: grid;
    place-items: center;
}
.sheet {
    margin-top: -1.4rem;
    background: var(--bg);
    border-radius: 1.4rem 1.4rem 0 0;
    padding: 1rem 1rem 1.4rem;
    min-height: 50dvh;
}
.banner {
    margin-bottom: .8rem;
    border-radius: .9rem;
    padding: .7rem .85rem;
    font-size: .88rem;
}
.banner.ok { background: #ecfdf5; color: var(--ok); }
.banner.bad { background: #fff1f2; color: var(--danger); }

.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: .95rem 1rem 1rem;
    margin-bottom: 1.15rem;
}
.stat h2 { margin: 0; color: var(--blue); font-size: 1rem; }
.stat-row {
    display: flex;
    gap: .4rem;
    margin-top: .7rem;
    color: var(--muted);
    font-size: .92rem;
}
.stat-row strong { color: var(--ink); font-weight: 700; }
.section-label {
    margin: 0 0 .7rem;
    color: var(--blue);
    font-size: 1.02rem;
    font-weight: 650;
}
.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .7rem;
}
.tile {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1rem;
    min-height: 7.1rem;
    padding: .85rem .45rem .7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    text-align: center;
    box-shadow: 0 8px 18px rgba(15, 39, 72, 0.04);
    color: var(--blue);
}
.tile span {
    color: var(--ink);
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.2;
}
.tile .ico { width: 1.85rem; height: 1.85rem; }

.nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--nav) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: #fff;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 20;
}
.nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    color: #94a3b8;
    font-size: .68rem;
    font-weight: 650;
}
.nav a.on { color: var(--blue); }
.nav .ico { width: 1.35rem; height: 1.35rem; }

.back {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    color: #fff;
    font-weight: 650;
    font-size: .92rem;
}
.search {
    display: flex;
    gap: .5rem;
    margin-bottom: .8rem;
}
.search input, .field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid #d7e1ee;
    background: #fff;
    border-radius: .85rem;
    padding: .8rem .9rem;
    outline: none;
}
.search input:focus, .field input:focus, .field select:focus, .field textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}
.field { display: block; margin-bottom: .75rem; }
.field span { display: block; margin-bottom: .3rem; font-size: .75rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: .85rem .9rem;
    margin-bottom: .6rem;
    display: block;
    box-shadow: 0 6px 16px rgba(15, 39, 72, 0.04);
}
.card strong { display: block; font-size: .95rem; }
.card small, .muted { color: var(--muted); }
.row { display: flex; justify-content: space-between; gap: .6rem; align-items: center; }
.price { color: var(--blue); font-weight: 750; }
.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: .15rem .5rem;
    font-size: .7rem;
    font-weight: 750;
    background: #eff6ff;
    color: var(--blue);
}
.badge.off { background: #f1f5f9; color: #64748b; }
.badge.warn { background: #fff7ed; color: var(--warn); }
.badge.ok { background: #ecfdf5; color: var(--ok); }
.fab {
    position: fixed;
    right: 1rem;
    bottom: calc(var(--nav) + var(--safe-b) + .8rem);
    width: 3.3rem;
    height: 3.3rem;
    border-radius: 1rem;
    border: 0;
    background: var(--blue);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 12px 24px rgba(29, 78, 216, 0.35);
}
.btn {
    width: 100%;
    border: 0;
    border-radius: .95rem;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    padding: .95rem 1rem;
    margin-top: .4rem;
}
.btn:disabled { opacity: .45; }
.btn.soft { background: #eff6ff; color: var(--blue); }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .8rem; }
.metric {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: .85rem;
}
.metric span { display: block; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.metric strong { display: block; margin-top: .25rem; font-size: 1.15rem; }
.suggest { position: relative; }
.suggest-box {
    position: absolute;
    left: 0; right: 0;
    z-index: 5;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: .9rem;
    box-shadow: var(--shadow);
    max-height: 16rem;
    overflow: auto;
    margin-top: .3rem;
}
.suggest-box button {
    width: 100%;
    text-align: left;
    border: 0;
    background: #fff;
    padding: .75rem .85rem;
    border-bottom: 1px solid var(--line);
}
.line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .4rem;
    align-items: center;
    padding: .7rem 0;
    border-bottom: 1px solid var(--line);
}
.step { display: inline-flex; align-items: center; gap: .25rem; }
.step button {
    width: 1.8rem; height: 1.8rem;
    border-radius: .5rem;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--blue);
}
.step input { width: 2.2rem; text-align: center; border: 0; padding: 0; }
.totalbar {
    position: sticky;
    bottom: calc(var(--nav) + var(--safe-b));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: .8rem;
    box-shadow: var(--shadow);
}
.login-body {
    min-height: 100dvh;
    background:
        radial-gradient(circle at top, rgba(96, 165, 250, 0.45), transparent 42%),
        linear-gradient(180deg, #1d4ed8 0%, #0f2748 100%);
}
.face {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.4rem;
}
.login-card {
    width: min(24rem, 100%);
    background: #fff;
    color: var(--ink);
    border-radius: 1.4rem;
    padding: 1.4rem 1.2rem 1.2rem;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.25);
}
.brand { text-align: center; color: #fff; margin-bottom: 1.1rem; }
.brand-mark {
    width: 4.2rem; height: 4.2rem;
    margin: 0 auto .7rem;
    border-radius: 1.2rem;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.brand h1 { margin: 0; font-size: 1.7rem; }
.brand p { margin: .25rem 0 0; color: rgba(255, 255, 255, 0.78); }
.eye {
    position: absolute; right: .7rem; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: var(--muted);
}
.pass { position: relative; }
