:root {
    --bg: #071a4a;
    --bg-2: #0e2b72;
    --bg-3: #10358e;
    --panel: rgba(255, 255, 255, 0.96);
    --panel-alt: rgba(255, 255, 255, 0.88);
    --line: rgba(17, 67, 164, 0.12);
    --text: #10204d;
    --muted: #6f7fa9;
    --primary: #1f6fff;
    --primary-2: #0cc0ff;
    --success: #11b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 22px 60px rgba(7, 26, 74, 0.18);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(12, 192, 255, 0.18), transparent 24%),
        radial-gradient(circle at bottom right, rgba(31, 111, 255, 0.22), transparent 26%),
        linear-gradient(135deg, #06153b 0%, #0a2364 45%, #0b2f80 100%);
    min-height: 100vh;
}

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

button,
input,
select {
    font: inherit;
}

.shell {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 24px 18px;
    background: linear-gradient(180deg, rgba(5, 19, 58, 0.94), rgba(11, 40, 107, 0.97));
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-2), var(--primary));
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 18px 34px rgba(31, 111, 255, 0.35);
}

.brand-title {
    font-size: 22px;
    font-weight: 700;
}

.brand-subtitle {
    opacity: 0.7;
    font-size: 13px;
    margin-top: 4px;
}

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

.nav-link {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    text-align: left;
    padding: 15px 18px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}

.nav-link:hover,
.nav-link.is-active {
    background: linear-gradient(135deg, rgba(31, 111, 255, 0.9), rgba(12, 192, 255, 0.65));
    color: #fff;
    transform: translateX(3px);
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.85;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tenant-card {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tenant-name {
    font-size: 20px;
    font-weight: 700;
    margin: 8px 0 6px;
}

.tenant-meta,
.muted {
    opacity: 0.72;
    font-size: 13px;
}

.logout-link {
    color: rgba(255,255,255,0.86);
    font-size: 14px;
    padding: 0 4px;
}

.main {
    padding: 22px 22px 30px;
}

.topbar {
    padding: 22px 26px;
    border-radius: var(--radius-lg);
    color: #fff;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    background:
        linear-gradient(135deg, rgba(7, 26, 74, 0.86), rgba(12, 49, 137, 0.74)),
        linear-gradient(135deg, rgba(12, 192, 255, 0.18), transparent);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.page-title {
    margin: 0;
    font-size: 34px;
    line-height: 1.15;
}

.page-subtitle {
    margin-top: 8px;
    opacity: 0.84;
    font-size: 14px;
}

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

.status-chip,
.date-chip {
    padding: 11px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 13px;
}

.status-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #3ef2a4;
    box-shadow: 0 0 0 6px rgba(62, 242, 164, 0.18);
}

.page-content {
    padding-top: 22px;
}

.dashboard-grid {
    display: grid;
    gap: 18px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.card {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: auto -40px -60px auto;
    width: 140px;
    height: 140px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(31, 111, 255, 0.18), transparent 68%);
}

.metric-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}

.metric-value {
    font-size: 32px;
    font-weight: 800;
    color: #0b1f53;
}

.metric-note {
    margin-top: 10px;
    font-size: 13px;
    color: var(--success);
}

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

.three-col {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 18px;
}

.card-title {
    margin: 0 0 18px;
    font-size: 22px;
}

.card-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: -8px;
    margin-bottom: 14px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 14px;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    color: #0f7a54;
    background: rgba(17, 185, 129, 0.16);
}

.badge-warning {
    color: #a16207;
    background: rgba(245, 158, 11, 0.16);
}

.badge-danger {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.16);
}

.badge-info {
    color: #1d4ed8;
    background: rgba(31, 111, 255, 0.13);
}

.list {
    display: grid;
    gap: 12px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(31, 111, 255, 0.08), rgba(12, 192, 255, 0.04));
    border: 1px solid rgba(31, 111, 255, 0.1);
}

.list-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.list-meta {
    color: var(--muted);
    font-size: 13px;
}

.progress {
    height: 10px;
    border-radius: 999px;
    background: rgba(16, 32, 77, 0.08);
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    border-radius: inherit;
}

.btn {
    border: none;
    border-radius: 14px;
    padding: 13px 18px;
    cursor: pointer;
    font-weight: 700;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 12px 28px rgba(31, 111, 255, 0.28);
}

.btn-block {
    width: 100%;
}

.module-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 18px;
}

.pill-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pill {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(31, 111, 255, 0.09);
    color: #1d4ed8;
    font-size: 13px;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 260px;
    text-align: center;
    gap: 10px;
}

.standalone {
    min-height: 100vh;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 480px 1fr;
}

.login-panel,
.login-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px;
}

.login-panel {
    background: rgba(255,255,255,0.96);
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.login-form label {
    display: grid;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
}

.login-form input {
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(17, 67, 164, 0.18);
    padding: 0 14px;
}

.login-title {
    font-size: 34px;
    margin: 28px 0 10px;
}

.login-desc {
    color: var(--muted);
    line-height: 1.8;
}

.hero-card {
    width: min(560px, 100%);
    padding: 36px;
    border-radius: 30px;
    background:
        radial-gradient(circle at top right, rgba(12, 192, 255, 0.18), transparent 30%),
        linear-gradient(135deg, rgba(4, 16, 51, 0.85), rgba(12, 49, 137, 0.62));
    color: #fff;
    box-shadow: var(--shadow);
}

.hero-kicker {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    font-size: 12px;
    letter-spacing: .08em;
}

.hero-card h2 {
    font-size: 40px;
    line-height: 1.2;
    margin: 20px 0;
}

.hero-list {
    margin: 0;
    padding-left: 20px;
    line-height: 2;
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

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

.kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.kv-item {
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(31, 111, 255, 0.08), rgba(12, 192, 255, 0.04));
    border: 1px solid rgba(31, 111, 255, 0.1);
}

.kv-key {
    color: var(--muted);
    font-size: 13px;
}

.kv-value {
    margin-top: 8px;
    font-size: 26px;
    font-weight: 800;
}

.footer-note {
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 1360px) {
    .metric-grid,
    .three-col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

    .login-page {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .main {
        padding: 14px;
    }

    .topbar {
        padding: 18px;
        border-radius: 22px;
    }

    .page-title {
        font-size: 28px;
    }

    .metric-grid,
    .three-col {
        grid-template-columns: 1fr;
    }

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