:root {
    --bg: #edf3fb;
    --panel: rgba(255, 255, 255, 0.92);
    --panel-strong: #ffffff;
    --line: #d7e2f0;
    --text: #15304e;
    --muted: #687a96;
    --primary: #2f67e7;
    --primary-dark: #1e4db5;
    --primary-soft: #edf4ff;
    --success: #169b69;
    --warning: #ea8b1d;
    --danger: #e24b55;
    --shadow: 0 22px 48px rgba(17, 49, 95, 0.09);
    --radius: 20px;
    --sidebar-width: 248px;
    --shell-max-width: 1500px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 14px;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(47, 103, 231, 0.14), transparent 28%),
        radial-gradient(circle at bottom left, rgba(22, 155, 105, 0.11), transparent 26%),
        linear-gradient(180deg, #f7fbff 0%, var(--bg) 100%);
}

body {
    padding: 18px 22px 24px;
}

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

button,
input,
select,
textarea {
    font: inherit;
    line-height: 1.2;
}

button {
    cursor: pointer;
}

code {
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #f5f8fc;
    color: #214679;
}

.app-shell {
    display: flex;
    width: min(100%, var(--shell-max-width));
    min-height: calc(100vh - 42px);
    margin: 0 auto;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(215, 226, 240, 0.9);
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 28px 60px rgba(17, 49, 95, 0.08);
}

.sidebar {
    width: var(--sidebar-width);
    padding: 20px 16px;
    border-right: 1px solid rgba(215, 226, 240, 0.9);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 18px;
    height: calc(100vh - 42px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    margin-bottom: 22px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(47, 103, 231, 0.08), rgba(47, 103, 231, 0.02));
    border: 1px solid rgba(47, 103, 231, 0.1);
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 0.98rem;
}

.brand span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.78rem;
}

.nav-group + .nav-group {
    margin-top: 22px;
}

.sidebar-main {
    display: grid;
    gap: 0;
}

.nav-group-title {
    margin: 0 0 12px;
    padding: 0 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.nav-list {
    display: grid;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 16px;
    color: var(--text);
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.nav-link:hover {
    transform: translateX(2px);
    background: rgba(47, 103, 231, 0.07);
}

.nav-link.is-active {
    background: linear-gradient(135deg, rgba(47, 103, 231, 0.13), rgba(47, 103, 231, 0.05));
    color: var(--primary-dark);
    box-shadow: inset 3px 0 0 var(--primary);
}

.nav-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(47, 103, 231, 0.1);
    font-size: 0.72rem;
    font-weight: 700;
}

.content-shell {
    flex: 1;
    padding: 18px 20px 24px;
    display: flex;
    flex-direction: column;
}

.dashboard-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.topbar {
    position: sticky;
    top: 18px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    border-radius: 18px;
    border: 1px solid rgba(215, 226, 240, 0.85);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.topbar-kicker,
.eyebrow {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar-title {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.15;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: auto;
}

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

.topbar-user strong,
.topbar-user span {
    display: block;
}

.topbar-user span:last-child {
    color: var(--muted);
    margin-top: 3px;
    font-size: 0.9rem;
}

.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #18396f, #2f67e7);
    color: #fff;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(215, 226, 240, 0.82);
    display: grid;
    gap: 10px;
}

.sidebar-account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(215, 226, 240, 0.92);
    box-shadow: 0 12px 24px rgba(17, 49, 95, 0.06);
}

.sidebar-account-meta strong,
.sidebar-account-meta span {
    display: block;
}

.sidebar-account-meta span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.8rem;
}

.sidebar-logout {
    display: block;
}

.flash-stack {
    margin: 0 0 16px;
    display: grid;
    gap: 10px;
}

.flash-stack.compact {
    margin: 0 0 18px;
}

.flash {
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 600;
}

.flash-success {
    background: rgba(22, 155, 105, 0.1);
    border-color: rgba(22, 155, 105, 0.14);
    color: #0d7b52;
}

.flash-error {
    background: rgba(226, 75, 85, 0.1);
    border-color: rgba(226, 75, 85, 0.14);
    color: #c23a43;
}

.stats-grid,
.panel-grid {
    display: grid;
    gap: 16px;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 16px;
}

.compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.two-column {
    grid-template-columns: 1.4fr 1fr;
    margin-bottom: 20px;
}

.metric-card,
.panel,
.glow-card {
    background: var(--panel);
    border: 1px solid rgba(215, 226, 240, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.metric-card {
    padding: 16px 16px 14px;
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.65rem;
    line-height: 1.08;
}

.metric-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.metric-kicker {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.panel {
    padding: 18px;
}

.panel.panel-compact {
    padding: 14px 16px;
}

.dashboard-modules {
    grid-template-columns: 1.45fr 0.95fr;
    margin-top: 8px;
    align-items: stretch;
    grid-template-rows: auto 1fr;
    flex: 1;
    min-height: 0;
}

.dashboard-panel {
    min-height: 0;
    min-width: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.summary-panel {
    grid-column: 1 / -1;
    min-height: 360px;
    display: flex;
    flex-direction: column;
}

.dashboard-trend-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    height: 100%;
    min-width: 0;
    flex: 1;
}

.dashboard-bar-card {
    min-height: 188px;
    padding: 10px 8px;
    border-radius: 16px;
    background: rgba(47, 103, 231, 0.04);
    border: 1px solid rgba(215, 226, 240, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    text-align: center;
    min-width: 0;
}

.dashboard-bar-value {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 0.78rem;
    white-space: nowrap;
}

.dashboard-bar-track {
    width: 28px;
    height: 112px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(47, 103, 231, 0.04), rgba(47, 103, 231, 0.1));
    padding: 6px 0;
}

.dashboard-bar-track span {
    display: block;
    width: 100%;
    max-width: 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, #6a98ff 0%, #2f67e7 100%);
    box-shadow: 0 10px 20px rgba(47, 103, 231, 0.22);
}

.dashboard-bar-card strong {
    font-size: 0.9rem;
    white-space: nowrap;
}

.dashboard-bar-card span:last-child {
    color: var(--muted);
    font-size: 0.76rem;
    white-space: nowrap;
}

.dashboard-map {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 0.92fr);
    gap: 12px;
    height: 100%;
    min-width: 0;
    align-items: start;
    flex: 1;
}

.dashboard-map-canvas {
    position: relative;
    min-height: 0;
    height: 230px;
    border-radius: 18px;
    border: 1px solid rgba(215, 226, 240, 0.9);
    background:
        radial-gradient(circle at 20% 20%, rgba(47, 103, 231, 0.08), transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(22, 155, 105, 0.08), transparent 22%),
        linear-gradient(180deg, rgba(247, 251, 255, 0.9), rgba(237, 243, 251, 0.9));
    overflow: hidden;
    min-width: 0;
}

.dashboard-map-shape {
    position: absolute;
    inset: 12% 12%;
    background:
        radial-gradient(circle at 24% 32%, rgba(47, 103, 231, 0.12) 0, rgba(47, 103, 231, 0.08) 18%, transparent 20%),
        radial-gradient(circle at 68% 24%, rgba(47, 103, 231, 0.15) 0, rgba(47, 103, 231, 0.09) 20%, transparent 22%),
        radial-gradient(circle at 77% 62%, rgba(47, 103, 231, 0.12) 0, rgba(47, 103, 231, 0.08) 16%, transparent 18%),
        radial-gradient(circle at 38% 68%, rgba(47, 103, 231, 0.12) 0, rgba(47, 103, 231, 0.08) 18%, transparent 20%),
        linear-gradient(135deg, rgba(47, 103, 231, 0.08), rgba(47, 103, 231, 0.03));
    border-radius: 45% 40% 42% 38% / 42% 44% 36% 40%;
    filter: blur(0.2px);
}

.dashboard-map-point {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: rgba(47, 103, 231, 0.18);
    border: 2px solid rgba(47, 103, 231, 0.72);
    box-shadow: 0 0 0 8px rgba(47, 103, 231, 0.08);
}

.dashboard-map-point span {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 22px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 6px 16px rgba(17, 49, 95, 0.08);
}

.dashboard-map-list {
    display: grid;
    gap: 8px;
    align-content: start;
    min-width: 0;
    align-self: start;
}

.dashboard-map-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(215, 226, 240, 0.9);
    min-width: 0;
}

.dashboard-map-row strong {
    font-size: 0.86rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-map-row span {
    color: var(--primary-dark);
    font-weight: 700;
    flex-shrink: 0;
}

.dashboard-summary-list {
    display: grid;
    gap: 12px;
    flex: 1;
    align-content: start;
}

.dashboard-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(215, 226, 240, 0.9);
}

.dashboard-summary-main strong,
.dashboard-summary-meta strong,
.dashboard-summary-meta span {
    display: block;
}

.dashboard-summary-main p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.dashboard-summary-meta {
    text-align: right;
    white-space: nowrap;
}

.dashboard-summary-meta span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
}

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

.panel-header h3 {
    margin: 0;
    font-size: 1.12rem;
}

.panel-inline-meta {
    display: inline-block;
    margin-left: 8px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.text-link {
    color: var(--primary);
    font-weight: 700;
}

.distribution-list,
.activity-list {
    display: grid;
    gap: 14px;
}

.distribution-row,
.activity-item {
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--panel-strong);
    border: 1px solid rgba(215, 226, 240, 0.8);
}

.distribution-meta,
.activity-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.activity-item p,
.table-sub {
    color: var(--muted);
}

.progress {
    margin: 12px 0 10px;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #eef4fb;
    overflow: hidden;
}

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

.trend-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.trend-summary-card {
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(47, 103, 231, 0.08), rgba(47, 103, 231, 0.03));
    border: 1px solid rgba(47, 103, 231, 0.08);
}

.trend-summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.4rem;
    line-height: 1.2;
}

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

.trend-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.trend-column-card {
    min-height: 280px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-radius: 18px;
    background: var(--panel-strong);
    border: 1px solid rgba(215, 226, 240, 0.8);
}

.trend-column-top strong,
.trend-column-top span,
.trend-column-meta strong,
.trend-column-meta span {
    display: block;
}

.trend-column-top strong {
    font-size: 1rem;
}

.trend-column-top span,
.trend-column-meta span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

.trend-column-track {
    flex: 1;
    min-height: 150px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px 0 0;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(47, 103, 231, 0.02), rgba(47, 103, 231, 0.08)),
        repeating-linear-gradient(
            to top,
            rgba(215, 226, 240, 0.7) 0,
            rgba(215, 226, 240, 0.7) 1px,
            transparent 1px,
            transparent 28px
        );
}

.trend-column-track span {
    display: block;
    width: 56px;
    max-width: 100%;
    min-height: 12px;
    border-radius: 16px 16px 8px 8px;
    background: linear-gradient(180deg, #5c8dff 0%, #2f67e7 55%, #1e4db5 100%);
    box-shadow: 0 10px 20px rgba(47, 103, 231, 0.22);
}

.trend-column-meta strong {
    font-size: 0.95rem;
}

.progress .badge-success {
    background: linear-gradient(135deg, var(--success), #0f7c54);
}

.progress .badge-warning {
    background: linear-gradient(135deg, var(--warning), #b46a11);
}

.progress .badge-danger {
    background: linear-gradient(135deg, var(--danger), #b7333c);
}

.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.activity-item p {
    margin: 8px 0 0;
}

.activity-extra {
    color: var(--primary-dark);
    font-weight: 700;
    white-space: nowrap;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.badge-primary {
    background: rgba(47, 103, 231, 0.1);
    color: var(--primary-dark);
}

.badge-success {
    background: rgba(22, 155, 105, 0.12);
    color: #0f7c54;
}

.badge-warning {
    background: rgba(234, 139, 29, 0.12);
    color: #b4680f;
}

.badge-danger {
    background: rgba(226, 75, 85, 0.12);
    color: #bf3741;
}

.badge-muted {
    background: rgba(104, 122, 150, 0.12);
    color: #51647f;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    font-size: 0.92rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 14px 28px rgba(47, 103, 231, 0.22);
}

.btn-secondary {
    background: #fff;
    color: var(--primary-dark);
    border-color: rgba(47, 103, 231, 0.16);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.65);
    color: var(--text);
    border-color: rgba(215, 226, 240, 0.85);
}

.btn-danger {
    background: rgba(226, 75, 85, 0.12);
    color: #bf3741;
    border-color: rgba(226, 75, 85, 0.14);
}

.btn-warning {
    background: rgba(234, 139, 29, 0.12);
    color: #b4680f;
    border-color: rgba(234, 139, 29, 0.14);
}

.btn-small {
    min-height: 32px;
    padding: 0 12px;
    font-size: 0.84rem;
}

.btn-block {
    width: 100%;
}

.field,
.checkbox-field {
    display: grid;
    gap: 8px;
}

.field span,
.checkbox-field span {
    display: flex;
    align-items: center;
    min-height: 18px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #2d476a;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(215, 226, 240, 0.95);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field textarea {
    min-height: 100px;
    resize: vertical;
}

.field.field-soft span {
    font-size: 0.86rem;
}

.field.field-soft input,
.field.field-soft select {
    min-height: 42px;
    padding: 9px 12px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(47, 103, 231, 0.42);
    box-shadow: 0 0 0 4px rgba(47, 103, 231, 0.08);
}

.checkbox-field {
    align-self: end;
    grid-auto-flow: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 42px;
    padding-bottom: 2px;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
}

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

.filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
}

.field-span-2 {
    grid-column: span 2;
}

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

.filter-actions {
    align-self: end;
    min-height: 42px;
}

.cards-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.cards-inline-form {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(215, 226, 240, 0.9);
    background: var(--panel-strong);
    min-width: 0;
}

.cards-inline-header {
    margin-bottom: 10px;
}

.cards-inline-header h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
}

.cards-inline-grid {
    display: grid;
    gap: 12px;
    align-items: end;
}

.cards-inline-grid > * {
    min-width: 0;
}

.cards-inline-grid-generate {
    grid-template-columns: minmax(0, 1.8fr) 112px 112px 112px 118px;
}

.cards-inline-grid-filter {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr) 150px;
}

.cards-inline-action {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    min-height: 42px;
}

.cards-inline-action .btn {
    min-height: 42px;
    white-space: nowrap;
    width: 100%;
}

.cards-inline-action-row {
    gap: 10px;
    justify-content: flex-start;
    align-items: flex-end;
    flex-wrap: nowrap;
}

.cards-inline-action-row .btn {
    width: auto;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(215, 226, 240, 0.8);
    text-align: left;
    vertical-align: middle;
    line-height: 1.45;
}

.data-table th {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.data-table td .status-chip,
.data-table td .btn,
.data-table td .table-actions,
.data-table td code {
    vertical-align: middle;
}

.table-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.table-inline strong,
.table-inline code,
.table-inline span {
    display: inline;
}

.table-stack {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.table-stack strong,
.table-stack span {
    display: block;
}

.inline-sub {
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.table-sub {
    margin: 0;
    font-size: 0.8rem;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    row-gap: 8px;
}

.table-actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.data-table td.is-middle {
    vertical-align: middle;
    white-space: nowrap;
}

.usage-log-table,
.logs-table {
    table-layout: fixed;
}

.usage-log-table th,
.usage-log-table td,
.logs-table th,
.logs-table td {
    padding-top: 16px;
    padding-bottom: 16px;
}

.usage-log-table th:nth-child(1),
.usage-log-table td:nth-child(1) {
    width: 18%;
}

.usage-log-table th:nth-child(2),
.usage-log-table td:nth-child(2) {
    width: 24%;
}

.usage-log-table th:nth-child(3),
.usage-log-table td:nth-child(3) {
    width: 12%;
}

.usage-log-table th:nth-child(4),
.usage-log-table td:nth-child(4) {
    width: 10%;
}

.usage-log-table th:nth-child(5),
.usage-log-table td:nth-child(5) {
    width: 16%;
}

.usage-log-table th:nth-child(6),
.usage-log-table td:nth-child(6) {
    width: 20%;
}

.usage-log-table td:not(.event-content-cell) {
    white-space: nowrap;
}

.usage-log-table td:nth-child(2),
.usage-log-table td:nth-child(6) {
    white-space: normal;
}

.software-version-cell strong {
    font-size: 1.08rem;
    font-weight: 800;
}

.data-table td .table-stack code {
    align-self: flex-start;
}

.logs-table th:nth-child(1),
.logs-table td:nth-child(1) {
    width: 16%;
}

.logs-table th:nth-child(2),
.logs-table td:nth-child(2) {
    width: 10%;
}

.logs-table th:nth-child(3),
.logs-table td:nth-child(3) {
    width: 32%;
}

.logs-table th:nth-child(4),
.logs-table td:nth-child(4) {
    width: 12%;
}

.logs-table th:nth-child(5),
.logs-table td:nth-child(5) {
    width: 14%;
}

.logs-table th:nth-child(6),
.logs-table td:nth-child(6) {
    width: 16%;
}

.logs-table td:nth-child(3),
.logs-table td:nth-child(4),
.logs-table td:nth-child(5),
.logs-table td:nth-child(6) {
    white-space: normal;
}

.table-actions a,
.table-actions button {
    white-space: nowrap;
}

.empty-state {
    padding: 28px 14px;
    text-align: center;
    color: var(--muted);
}

.empty-state h4 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 1.05rem;
}

.modal {
    width: min(680px, calc(100vw - 24px));
    padding: 0;
    border: 0;
    border-radius: 22px;
    overflow: hidden;
    background: transparent;
}

.modal::backdrop {
    background: rgba(9, 24, 44, 0.38);
    backdrop-filter: blur(4px);
}

.modal-form {
    padding: 20px;
    background: var(--panel-strong);
    border-radius: 22px;
    border: 1px solid rgba(215, 226, 240, 0.9);
    box-shadow: 0 26px 58px rgba(12, 38, 76, 0.16);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.icon-button {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(215, 226, 240, 0.9);
    background: #fff;
    color: var(--muted);
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 28px;
}

.login-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(360px, 460px) minmax(320px, 1fr);
    gap: 24px;
}

.login-panel,
.setup-panel {
    padding: 34px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    border: 1px solid rgba(215, 226, 240, 0.92);
    box-shadow: var(--shadow);
}

.login-header h1,
.glow-card h2,
.setup-panel h1 {
    margin: 0;
    font-size: 2.2rem;
    line-height: 1.14;
}

.login-header p:last-child,
.setup-panel p {
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-aside {
    display: flex;
}

.glow-card {
    padding: 34px;
    width: 100%;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.32), transparent 34%),
        linear-gradient(135deg, #18439a 0%, #2f67e7 52%, #5ea4ff 100%);
    color: #fff;
}

.glow-card .eyebrow {
    color: rgba(255, 255, 255, 0.78);
}

.feature-list {
    margin: 22px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 14px;
    line-height: 1.6;
}

.setup-shell {
    width: min(860px, 100%);
}

.setup-error {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(226, 75, 85, 0.1);
    border: 1px solid rgba(226, 75, 85, 0.14);
    color: #bf3741;
}

.setup-steps {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.setup-step {
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(215, 226, 240, 0.92);
}

.setup-step strong {
    display: block;
    margin-bottom: 6px;
}

.setup-step p {
    margin: 0;
}

@media (max-width: 1180px) {
    .sidebar {
        width: 220px;
    }

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

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trend-chart {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .cards-toolbar {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 920px) {
    body {
        padding: 12px;
    }

    .app-shell {
        flex-direction: column;
        min-height: calc(100vh - 24px);
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: 0;
        border-bottom: 1px solid rgba(215, 226, 240, 0.9);
    }

    .content-shell {
        padding: 14px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }

    .form-grid,
    .filter-grid,
    .login-shell {
        grid-template-columns: 1fr;
    }

    .cards-inline-grid-generate,
    .cards-inline-grid-filter {
        grid-template-columns: 1fr;
    }

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

    .dashboard-bar-card {
        min-height: auto;
    }

    .dashboard-bar-track {
        min-height: 110px;
    }

    .field-span-2 {
        grid-column: auto;
    }
}

@media (max-width: 620px) {
    .login-body {
        padding: 16px;
    }

    .login-panel,
    .setup-panel,
    .glow-card,
    .panel,
    .metric-card {
        padding: 22px;
    }

    .topbar {
        padding: 14px;
    }

    .topbar-title,
    .login-header h1,
    .glow-card h2,
    .setup-panel h1 {
        font-size: 1.4rem;
    }

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