:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --ink: #1e293b;
    --muted: #94a3b8;
    --line: #e8eef6;
    --blue: #2563eb;
    --blue-soft: #e8f1ff;
    --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 10% 10%, #dbeafe, transparent 40%),
        radial-gradient(circle at 90% 0%, #e0e7ff, transparent 36%),
        var(--bg);
}

.login-box {
    width: min(420px, calc(100% - 32px));
    background: var(--card);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.login-box h1 { margin: 0 0 6px; font-size: 28px; }
.muted { color: var(--muted); font-size: 13px; }

label { display: block; margin-top: 14px; font-size: 13px; color: var(--muted); }

input[type="email"], input[type="password"], input[type="number"], input[type="text"], input[type="search"] {
    width: 100%;
    margin-top: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
}

.btn {
    border: 0;
    background: var(--blue);
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}
a.btn { display: inline-block; text-decoration: none; color: #fff; margin-bottom: 8px; }

.btn.ghost { background: #eef2f7; color: var(--ink); }
.btn.danger { background: var(--danger); }

.alert {
    background: #fef2f2;
    color: var(--danger);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.local-note {
    background: #fff7ed;
    color: #9a3412;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 12px;
}

.shell { display: flex; min-height: 100vh; }

.side {
    width: 248px;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    flex: none;
}

.brand {
    color: var(--blue);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    padding: 6px 12px 18px;
}

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    color: #64748b;
    font-weight: 600;
}

.nav a.active, .nav a:hover {
    background: var(--blue-soft);
    color: var(--blue);
}

.nav-ico {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: #f1f5f9;
    color: #64748b;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
}

.nav a.active .nav-ico { background: #dbeafe; color: var(--blue); }

.side-foot { margin-top: auto; padding: 12px; }
.side-foot a { color: #64748b; font-weight: 700; }

.workspace { flex: 1; min-width: 0; }

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 22px;
    background: rgba(244, 247, 251, 0.9);
    position: sticky;
    top: 0;
}

.search { flex: 1; }
.search input { margin: 0; background: #fff; border-radius: 999px; }

.who { display: flex; align-items: center; gap: 10px; }
.who b, .who span { display: block; }
.who span { color: var(--muted); font-size: 12px; }

.avatar, .face {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #dbeafe;
    color: var(--blue);
    font-weight: 800;
    object-fit: cover;
    flex: none;
}

.main { padding: 6px 22px 28px; }

.head, .card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.head h1, .card h2 { margin: 0; }
.head h1 { font-size: 28px; }
.range, .pill {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 12px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }

.stat, .card {
    background: var(--card);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.stat { display: flex; gap: 12px; align-items: center; }
.stat small { color: var(--muted); font-weight: 600; }
.stat b { display: block; font-size: 26px; margin-top: 2px; }

.bubble {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
}
.bubble.blue { background: #3b82f6; }
.bubble.green { background: #22c55e; }
.bubble.pink { background: #f43f5e; }
.bubble.amber { background: #f59e0b; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-top: 14px; }
.card { margin-top: 0; }
.card h2 { font-size: 16px; }
.card-top { margin-bottom: 12px; }
.card-top a { color: var(--blue); font-size: 13px; font-weight: 700; }

.chart { width: 100%; height: 190px; display: block; }

.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: none;
}
.donut div {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    text-align: center;
}
.donut b { font-size: 18px; }
.donut span, .legend { color: var(--muted); font-size: 13px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend b { margin-left: auto; color: var(--ink); }

.person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}
.person div { min-width: 0; flex: 1; }
.person b, .person span { display: block; }
.person span {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.person em { color: var(--muted); font-style: normal; font-size: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.card table { margin-top: 8px; }

.face { width: 46px; height: 46px; }
.home-grid { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; margin-top: 12px; }
.home-facts p { margin: 0 0 10px; color: #64748b; }
.home-facts b { display: block; color: var(--ink); font-size: 12px; }
.home-phone { background: #f0f2f5; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.home-bar, .home-mind, .home-post { background: #fff; }
.home-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; color: #0866ff; }
.home-mind { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 12px 14px; color: #65676b; }
.home-mind .ask { flex: 1; background: #f0f2f5; border-radius: 20px; padding: 10px 14px; }
.home-stories { display: flex; gap: 8px; padding: 12px; }
.home-story { width: 72px; height: 96px; border-radius: 12px; background: linear-gradient(160deg, #60a5fa, #0866ff); color: #fff; display: grid; place-items: center; font-weight: 800; text-decoration: none; }
.home-post { margin: 0 0 8px; padding: 12px 14px; }
.home-post b, .home-post small, .home-post p { display: block; }
.home-post small { color: var(--muted); margin-top: 2px; }
.home-post p { margin: 8px 0 0; }
.home-empty { padding: 8px 14px 16px; }
@media (max-width: 800px) { .home-grid { grid-template-columns: 1fr; } }
.photo-form { margin-top: 8px; display: grid; gap: 6px; }
.photo-form input[type="file"] { max-width: 180px; font-size: 12px; }
.handle-form { display: flex; gap: 6px; align-items: center; }
.handle-form input[type="text"] { width: 140px; margin: 0; padding: 8px 10px; }
.row { display: flex; gap: 8px; align-items: center; }
.switch { display: flex; align-items: center; gap: 8px; margin: 12px 0; }

@media (max-width: 980px) {
    .shell { display: block; }
    .side { width: auto; }
    .nav { flex-direction: row; overflow: auto; }
    .nav a { white-space: nowrap; }
    .side-foot { margin-top: 8px; }
    .stats, .grid-2 { grid-template-columns: 1fr; }
    .donut-wrap { flex-direction: column; align-items: flex-start; }
}

body.dash-on { background: #eef3f8; }
.dash {
    width: min(430px, 100%);
    height: 100vh;
    margin: 0 auto;
    background: #fff;
    color: #09183f;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dash svg { width: 22px; height: 22px; }
.dash-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px; }
.dash-logo { color: #0864ed; font-weight: 800; font-size: 34px; letter-spacing: -1px; line-height: 1; }
.dash-top p { margin: 4px 0 0; color: #7286aa; font-size: 13px; }
.dash-tools { display: flex; align-items: center; gap: 12px; }
.dash-bell { position: relative; color: #09183f; display: grid; place-items: center; width: 36px; height: 36px; }
.dash-bell span { position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px; border-radius: 99px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.dash-admin { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.dash-admin b, .dash-admin small { display: block; }
.dash-admin b { font-size: 14px; }
.dash-admin small { color: #7185aa; font-size: 12px; }
.dash-admin svg { width: 16px; height: 16px; color: #7185aa; }
.dash-face { width: 40px; height: 40px; border-radius: 50%; background: #e6f1ff; color: #0864ed; display: grid; place-items: center; font-weight: 800; }
.dash-main { padding: 8px 16px 18px; display: grid; gap: 14px; overflow: auto; flex: 1; }
.dash-hello { position: relative; overflow: hidden; min-height: 132px; border-radius: 18px; background: linear-gradient(90deg, #edf5ff, #e8f2ff); padding: 22px 18px; }
.dash-hello p { margin: 0; font-size: 16px; }
.dash-hello h1 { margin: 2px 0 0; font-size: 30px; letter-spacing: -0.5px; }
.dash-hello span { display: block; margin-top: 8px; color: #5774a5; font-size: 14px; }
.dash-chart { position: absolute; right: 12px; bottom: 14px; width: 108px; height: 72px; border-radius: 16px; background: rgba(255,255,255,.55); display: flex; align-items: flex-end; gap: 6px; padding: 10px; }
.dash-chart i { display: block; width: 16px; border-radius: 4px; background: #76b3ff; }
.dash-chart i:nth-child(2) { height: 28px; background: #328dff; }
.dash-chart i:nth-child(1) { height: 16px; }
.dash-chart i:nth-child(3) { height: 40px; background: #0869f5; }
.dash-chart svg { position: absolute; right: 6px; top: -18px; width: 54px; height: 54px; color: #328dff; }
.dash-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash-stat { border-radius: 16px; padding: 14px; display: flex; gap: 10px; min-height: 118px; }
.dash-stat.blue { background: #f2f7ff; border: 1px solid #e4efff; }
.dash-stat.green { background: #f0fcf8; border: 1px solid #e1f5ee; }
.dash-stat.red { background: #fff4f5; border: 1px solid #ffeaed; }
.dash-stat.purple { background: #f6f4ff; border: 1px solid #ece9ff; }
.dash-stat .ico { width: 42px; height: 42px; border-radius: 14px; color: #fff; display: grid; place-items: center; flex: none; }
.dash-stat.blue .ico { background: #1978fa; }
.dash-stat.green .ico { background: #00c991; }
.dash-stat.red .ico { background: #ff475b; }
.dash-stat.purple .ico { background: #7957fa; }
.dash-stat h2 { margin: 0; font-size: 13px; font-weight: 600; }
.dash-stat b { display: block; margin-top: 4px; font-size: 22px; letter-spacing: -0.4px; }
.dash-stat em { display: flex; align-items: center; gap: 2px; margin-top: 6px; color: #00bf78; font-style: normal; font-size: 12px; font-weight: 700; }
.dash-stat em.down { color: #ef4444; }
.dash-stat em svg { width: 14px; height: 14px; }
.dash-stat small { display: block; color: #56709e; font-size: 11px; }
.dash-tiles { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.dash-tile { position: relative; min-height: 118px; border: 1px solid #eaf0f8; border-radius: 16px; background: #fff; padding: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); text-decoration: none; color: inherit; }
.dash-tile .ico { width: 42px; height: 42px; border-radius: 14px; color: #fff; display: grid; place-items: center; }
.dash-tile .ico.blue { background: #1978fa; }
.dash-tile .ico.green { background: #00c991; }
.dash-tile .ico.amber { background: #ffa900; }
.dash-tile .ico.purple { background: #7957fa; }
.dash-tile .ico.red { background: #ff475b; }
.dash-tile .ico.slate { background: #7088a9; }
.dash-tile > svg { position: absolute; right: 12px; top: 28px; width: 16px; height: 16px; color: #8194b6; }
.dash-tile h3 { margin: 10px 0 0; font-size: 15px; font-weight: 600; }
.dash-tile p { margin: 4px 0 0; color: #7186ad; font-size: 12px; }
.dash-activity { display: flex; align-items: center; gap: 12px; min-height: 72px; border: 1px solid #eaf0fa; border-radius: 16px; background: #f3f8ff; padding: 12px 14px; text-decoration: none; color: inherit; }
.dash-activity .ico { width: 42px; height: 42px; border-radius: 14px; background: #eaf3ff; color: #0b255d; display: grid; place-items: center; flex: none; }
.dash-activity span { flex: 1; min-width: 0; }
.dash-activity b, .dash-activity small { display: block; }
.dash-activity small { color: #7186ad; font-size: 12px; margin-top: 2px; }
.dash-activity em { display: flex; align-items: center; gap: 4px; color: #0864ed; font-style: normal; font-size: 13px; font-weight: 600; }
.dash-activity em svg { width: 14px; height: 14px; }
.dash-nav { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid #edf1f7; background: #fff; padding: 10px 6px 16px; }
.dash-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #7186ad; text-decoration: none; font-size: 11px; position: relative; }
.dash-nav a.on { color: #0864ed; }
.dash-nav a.on::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 28px; height: 3px; border-radius: 99px; background: #0864ed; transform: translateX(-50%); }
.dash-nav svg { width: 22px; height: 22px; }
@media (min-width: 900px) {
    body.dash-on { padding: 24px 0; }
    .dash { height: calc(100vh - 48px); border-radius: 36px; border: 10px solid #111; box-shadow: 0 20px 65px rgba(25, 75, 115, .2); }
}
