:root {
    --bg: #f6f3f8;
    --panel: rgba(255, 255, 255, .82);
    --ink: #303852;
    --muted: #7a8195;
    --line: rgba(207, 211, 222, .76);
    --blue: #5a7eea;
    --cyan: #64cddd;
    --orange: #f07d54;
    --yellow: #f2b735;
    --green: #78d36b;
    --purple: #9a56d7;
    --red: #dc2626;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 28% 12%, rgba(252, 226, 234, .95), transparent 34%),
        radial-gradient(circle at 80% 52%, rgba(230, 223, 250, .9), transparent 36%),
        linear-gradient(135deg, #fbfbfd 0%, var(--bg) 52%, #f1eef8 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 86px;
    background: rgba(255, 255, 255, .78);
    border-right: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 16px 0 40px rgba(75, 83, 111, .08);
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    backdrop-filter: blur(14px);
}

.brand {
    display: grid;
    place-items: center;
    gap: 6px;
    text-align: center;
}

.brand-mark {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, #e84393, #f6c445 48%, #3867e8);
    font-weight: 900;
}

.brand strong,
.brand small,
nav a b {
    display: none;
}

nav {
    display: grid;
    gap: 12px;
    width: 100%;
}

nav a {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #6a78a0;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 10px 22px rgba(77, 88, 120, .08);
    font-weight: 900;
}

nav a:hover {
    color: #fff;
    background: linear-gradient(135deg, #6689f2, #4c70d8);
}

.user-box {
    margin-top: auto;
    display: grid;
    gap: 8px;
    width: 100%;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.user-box a {
    padding: 8px 4px;
    border-radius: 10px;
    background: #fff;
    color: var(--blue);
    font-weight: 800;
}

.main {
    margin-left: 86px;
    padding: 38px 44px 32px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 4px 0 10px;
    font-size: 28px;
    line-height: 1.1;
}

.kicker {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clock,
.top-actions input,
.top-actions select {
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 10px 24px rgba(75, 83, 111, .08);
    color: var(--muted);
    font-weight: 700;
}

.top-actions input {
    width: 230px;
}

.clock {
    display: grid;
    place-items: center;
    padding: 0 14px;
    white-space: nowrap;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

h2 {
    margin: 0;
    font-size: 21px;
}

.notice-btn {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border-radius: 9px;
    padding: 0 16px;
    color: #fff;
    background: #f26f21;
    box-shadow: 0 10px 24px rgba(242, 111, 33, .22);
    font-size: 13px;
    font-weight: 900;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 18px;
}

.stat,
.panel,
.help-panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, .86);
    border-radius: 10px;
    box-shadow: 0 18px 36px rgba(82, 91, 124, .1);
    backdrop-filter: blur(10px);
}

.stat {
    min-height: 74px;
    padding: 14px 18px 14px 96px;
    position: relative;
    display: grid;
    align-content: center;
}

.stat .ring {
    position: absolute;
    left: 22px;
    top: 50%;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    transform: translateY(-50%);
    border: 8px solid currentColor;
    border-left-color: rgba(255, 255, 255, .82);
}

.stat .ring::after {
    content: "UP";
    position: absolute;
    inset: 8px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-size: 11px;
    font-weight: 900;
}

.stat span:not(.ring) {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.stat strong {
    font-size: 30px;
    line-height: 1;
}

.stat-orange { color: var(--orange); }
.stat-cyan { color: var(--cyan); }
.stat-yellow { color: var(--yellow); }
.stat-green { color: var(--green); }
.stat-purple { color: var(--purple); }

.workbench {
    display: grid;
    grid-template-columns: repeat(4, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.panel {
    padding: 20px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.action-card {
    display: grid;
    gap: 12px;
}

.action-card h2 {
    font-size: 16px;
}

.action-badge {
    border-radius: 999px;
    padding: 6px 10px;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.action-badge.orange { background: var(--orange); }
.action-badge.cyan { background: var(--cyan); }
.action-badge.blue { background: var(--blue); }
.action-badge.green { background: var(--green); }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

label {
    display: grid;
    gap: 7px;
    color: #596075;
    font-weight: 800;
    font-size: 12px;
}

input,
select {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(216, 220, 232, .9);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, .92);
    outline: none;
}

input:focus,
select:focus,
.scan-input {
    border-color: #86a2ff;
    box-shadow: 0 0 0 4px rgba(90, 126, 234, .12);
}

button {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #597df0, #4167d3);
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 22px rgba(65, 103, 211, .18);
}

button:hover {
    filter: brightness(.98);
}

.mini-total,
.mini-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.mini-total strong,
.mini-split strong {
    color: var(--ink);
    font-size: 22px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 18px;
    margin-bottom: 18px;
}

.download-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 8px 18px rgba(82, 91, 124, .12);
    font-weight: 900;
}

.product-bars {
    display: grid;
    gap: 15px;
}

.bar-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    align-items: center;
    gap: 16px;
}

.bar-row strong {
    display: block;
    font-size: 13px;
}

.bar-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.bar-track {
    height: 9px;
    border-radius: 999px;
    background: #eef1f7;
    overflow: hidden;
}

.bar-track span {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: linear-gradient(90deg, #f07d54, #5a7eea);
}

.meter-panel {
    display: grid;
}

.meter {
    min-height: 190px;
    display: grid;
    place-items: center;
    align-content: center;
    position: relative;
}

.meter-arc {
    position: absolute;
    width: 172px;
    height: 172px;
    border-radius: 50%;
    background: conic-gradient(var(--orange) 0 255deg, #fff 255deg 360deg);
    mask: radial-gradient(circle, transparent 53px, #000 54px);
}

.meter strong {
    z-index: 1;
    font-size: 30px;
}

.meter span {
    z-index: 1;
    color: var(--muted);
    font-weight: 800;
}

.activity-panel {
    margin-bottom: 18px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    text-align: left;
    padding: 13px 10px;
    border-bottom: 1px solid rgba(220, 224, 234, .8);
    font-size: 13px;
}

th {
    color: var(--muted);
    font-size: 12px;
}

.tag {
    background: #eef4ff;
    color: #4167d3;
    padding: 6px 9px;
    border-radius: 7px;
    text-transform: capitalize;
    font-weight: 800;
}

.small-link {
    color: var(--blue);
    font-size: 13px;
    font-weight: 900;
}

.scan-layout {
    display: grid;
    grid-template-columns: minmax(320px, 520px) 1fr;
    gap: 18px;
    align-items: start;
}

.form-panel {
    display: grid;
    gap: 14px;
}

.help-panel {
    padding: 22px;
    color: var(--muted);
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 800;
}

.alert-success {
    background: #e8f8f0;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: var(--red);
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 20px;
    background: #eef2f7;
}

.auth-card {
    width: min(440px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 18px 42px rgba(16, 24, 39, .12);
    display: grid;
    gap: 14px;
}

.auth-card h1 {
    margin: 0;
}

.auth-card p {
    margin: 0 0 8px;
    color: var(--muted);
}

.setup-link {
    color: var(--blue);
    font-weight: 700;
    text-align: center;
}

@media (max-width: 1180px) {
    .stats-grid,
    .workbench {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 760px) {
    .sidebar {
        position: static;
        width: auto;
        flex-direction: row;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .brand,
    .user-box {
        min-width: 70px;
    }

    nav {
        display: flex;
        width: auto;
    }

    .main {
        margin-left: 0;
        padding: 18px;
    }

    .topbar,
    .top-actions,
    .section-title {
        align-items: stretch;
        flex-direction: column;
    }

    .top-actions input {
        width: 100%;
    }

    .stats-grid,
    .workbench,
    .scan-layout,
    .two-col,
    .bar-row {
        grid-template-columns: 1fr;
    }
}
