:root {
    --color-primary: #536b8e;
    --color-primary-hover: #465c7c;
    --color-primary-subtle: #edf1f6;
    --color-primary-strong: #364b69;

    --color-accent: #5d7869;
    --color-accent-subtle: #edf3ef;

    --color-text: #102033;
    --color-text-secondary: #5e6b7f;
    --color-text-muted: #8c97a8;

    --color-bg: #f4f7fb;
    --color-surface: rgba(255, 255, 255, 0.92);
    --color-surface-solid: #ffffff;
    --color-surface-muted: #f8fbff;

    --color-border: #d9e2ef;
    --color-border-light: #ebf1f8;

    --color-sidebar-bg: #0e1726;
    --color-sidebar-bg-soft: #13203a;
    --color-sidebar-text: #9db0cf;
    --color-sidebar-active: rgba(255, 255, 255, 0.1);
    --color-sidebar-hover: rgba(255, 255, 255, 0.06);

    --color-success: #5d7869;
    --color-warning: #896f3f;
    --color-danger: #965b5f;
    --color-info: #5b7683;

    --shadow-xs: 0 2px 10px rgba(12, 23, 42, 0.04);
    --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.07);
    --shadow-md: 0 20px 60px rgba(15, 23, 42, 0.12);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top right, rgba(83, 107, 142, 0.07), transparent 28%),
        radial-gradient(circle at bottom left, rgba(93, 120, 105, 0.06), transparent 24%),
        var(--color-bg);
    color: var(--color-text);
    font-family: "Inter", "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-hover);
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 272px;
    height: 100vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
        linear-gradient(180deg, var(--color-sidebar-bg) 0%, var(--color-sidebar-bg-soft) 100%);
    color: var(--color-sidebar-text);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: width 0.22s ease;
    z-index: 1040;
    overflow: hidden;
}

.sidebar-header {
    height: 78px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f8fbff;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5f7392, #506780);
    box-shadow: 0 8px 20px rgba(54, 70, 98, 0.18);
}

.brand-mark i {
    font-size: 18px;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-subtext {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.58);
}

.sidebar-menu {
    height: calc(100vh - 78px - 70px);
    overflow-y: auto;
    padding: 16px 12px 14px;
}

.sidebar-section-label {
    padding: 10px 12px 8px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.34);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.app-sidebar .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 4px;
    color: var(--color-sidebar-text);
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.app-sidebar .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 15px;
    opacity: 0.86;
}

.app-sidebar .nav-link:hover {
    background: var(--color-sidebar-hover);
    color: #ffffff;
    transform: translateX(2px);
}

.app-sidebar .nav-link.active {
    background: rgba(83, 107, 142, 0.22);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.app-sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: #8798b0;
}

.app-sidebar .sidebar-group-toggle {
    position: relative;
}

.submenu-arrow {
    font-size: 11px;
    transition: transform 0.18s ease;
}

.sidebar-group.expanded .submenu-arrow {
    transform: rotate(180deg);
}

.sidebar-submenu {
    list-style: none;
    margin: 0 0 10px;
    padding: 6px 0 0 38px;
    display: none;
}

.sidebar-submenu.show {
    display: block;
}

.sidebar-submenu-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    margin: 3px 0;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.sidebar-submenu-link:hover {
    background: var(--color-sidebar-hover);
    color: #ffffff;
}

.sidebar-submenu-link.active {
    background: rgba(83, 107, 142, 0.22);
    color: #ffffff;
}

.sidebar-footer {
    height: 70px;
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #f8fbff;
}

.app-main.authenticated {
    margin-left: 272px;
    min-height: 100vh;
    transition: margin-left 0.22s ease;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    backdrop-filter: blur(20px);
    background: rgba(244, 247, 251, 0.84);
    border-bottom: 1px solid rgba(217, 226, 239, 0.72);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.topbar-context {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.topbar-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.topbar-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--color-text);
}

.topbar-cta {
    padding-inline: 16px;
}

.topbar-user {
    min-height: 38px;
    padding-inline: 10px 12px;
}

.user-avatar {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

.page-shell {
    padding: 28px;
}

.flash-stack {
    margin-bottom: 18px;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 18, 32, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 1035;
}

.sidebar-collapsed .app-sidebar {
    width: 78px;
}

.sidebar-collapsed .app-main.authenticated {
    margin-left: 78px;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .menu-text,
.sidebar-collapsed .sidebar-section-label,
.sidebar-collapsed .sidebar-footer {
    display: none;
}

.sidebar-collapsed .sidebar-header {
    padding-inline: 18px;
}

.sidebar-collapsed .app-sidebar .nav-link {
    justify-content: center;
    padding: 12px 10px;
}

.sidebar-collapsed .app-sidebar .nav-link.active::before,
.sidebar-collapsed .submenu-arrow,
.sidebar-collapsed .sidebar-submenu {
    display: none !important;
}

.card {
    border: 1px solid rgba(217, 226, 239, 0.9);
    border-radius: var(--radius);
    background: var(--color-surface);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-xs);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
    border-color: #c9d7ea;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--color-border-light);
    border-radius: var(--radius) var(--radius) 0 0 !important;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.92), rgba(255, 255, 255, 0.82));
}

.card-header h6 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.01em;
}

.card-body {
    padding: 22px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding: 24px 28px;
    border: 1px solid rgba(217, 226, 239, 0.9);
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(241, 247, 255, 0.88)),
        var(--color-surface-solid);
    box-shadow: var(--shadow-sm);
}

.page-header h4 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--color-text);
}

.page-header p {
    margin: 8px 0 0;
    color: var(--color-text-secondary);
}

.page-header .page-kicker {
    display: none;
}

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

.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--color-primary-subtle);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.metric-card {
    padding: 18px 18px 16px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.9));
    box-shadow: var(--shadow-xs);
}

.metric-label {
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.metric-value {
    margin-top: 8px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-text);
}

.metric-note {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.filter-panel {
    padding: 20px 22px;
    border: 1px solid var(--color-border);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(255, 255, 255, 0.92));
    box-shadow: var(--shadow-xs);
}

.filter-panel .form-label {
    margin-bottom: 7px;
}

.filter-panel-compact {
    padding: 18px 22px;
}

.filter-primary-row {
    display: grid;
    grid-template-columns: minmax(220px, 2.2fr) repeat(2, minmax(160px, 1fr)) auto;
    gap: 14px;
    align-items: center;
}

.filter-primary-row.filter-primary-row-wide {
    grid-template-columns: minmax(220px, 2.3fr) minmax(160px, 1.1fr) auto;
}

.filter-compact-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-compact-field .form-control,
.filter-compact-field .form-select {
    min-height: 44px;
}

.filter-actions-inline {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-advanced-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 14px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--color-border);
}

.filter-advanced-row[hidden] {
    display: none !important;
}

.filter-toggle-btn {
    white-space: nowrap;
}

.filter-toggle-btn i {
    transition: transform 0.2s ease;
}

.filter-toggle-btn.expanded i {
    transform: rotate(180deg);
}

.filter-bar {
    padding: 20px 22px;
    border: 1px solid var(--color-border);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(255, 255, 255, 0.92));
    box-shadow: var(--shadow-xs);
    margin-bottom: 20px;
}

.filter-bar .form-label {
    margin-bottom: 7px;
}

.module-switch {
    max-width: 220px;
    min-height: 42px;
    font-size: 13px;
}

.tab-section {
    border-bottom-color: var(--color-border);
}

.tab-section .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 13px;
}

.tab-section .nav-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: transparent;
}

.stat-card {
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 126px;
    padding: 22px 20px 18px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.92));
    box-shadow: var(--shadow-xs);
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -18px;
    top: -22px;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08), transparent 68%);
}

.stat-accent {
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 4px;
    border-radius: 999px;
}

.stat-value {
    position: relative;
    z-index: 1;
    font-size: 34px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--color-text);
}

.stat-label {
    position: relative;
    z-index: 1;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px 0;
}

.table-toolbar h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.table-toolbar small {
    color: var(--color-text-muted);
}

.table-responsive {
    border-radius: 0 0 var(--radius) var(--radius);
}

.table {
    margin-bottom: 0;
}

.table th {
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
    background: rgba(248, 251, 255, 0.72);
    white-space: nowrap;
}

.table td {
    padding: 14px;
    vertical-align: middle;
    font-size: 13px;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-light);
}

.table-hover > tbody > tr:hover > * {
    background: rgba(232, 240, 255, 0.34);
}

.item-title {
    font-weight: 700;
    color: var(--color-text);
}

.item-meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.status-badge {
    min-width: 68px;
    text-align: center;
}

.btn {
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    white-space: nowrap;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

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

.btn-sm {
    padding: 6px 11px;
    font-size: 12px;
    border-radius: 10px;
}

.btn-primary {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, var(--color-primary), #3b82f6);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover {
    border-color: var(--color-primary-hover);
    background: linear-gradient(135deg, var(--color-primary-hover), var(--color-primary));
}

.btn-light {
    color: var(--color-text-secondary);
    border-color: var(--color-border);
    background: rgba(255, 255, 255, 0.82);
}

.btn-light:hover {
    color: var(--color-text);
    border-color: #cbd6e4;
    background: #ffffff;
}

.form-control,
.form-select {
    min-height: 44px;
    border-radius: 12px;
    border-color: var(--color-border);
    padding: 10px 14px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-text);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.62);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-secondary);
    letter-spacing: 0.01em;
}

.detail-label {
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.detail-block {
    padding: 18px;
    border: 1px solid var(--color-border-light);
    border-radius: 18px;
    background: rgba(248, 251, 255, 0.72);
}

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

.info-tile {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--color-border-light);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.82));
}

.section-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.activity-stream {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.activity-item {
    position: relative;
    padding: 16px 18px 16px 48px;
    border: 1px solid var(--color-border-light);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.92));
}

.activity-item::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-primary), #60a5fa);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.activity-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.activity-meta small {
    color: var(--color-text-muted);
}

.summary-panel {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(255, 255, 255, 0.92));
    box-shadow: var(--shadow-xs);
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 20px;
}

.editor-section + .editor-section {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--color-border-light);
}

.editor-section h6 {
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 700;
}

.editor-side-card {
    position: sticky;
    top: 96px;
}

.editor-helper {
    font-size: 12px;
    color: var(--color-text-muted);
}

.editor-highlight {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-text);
}

.editor-soft-block {
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(255, 255, 255, 0.92));
}

.system-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
    gap: 20px;
}

.system-note-card,
.system-stat-card {
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.94));
    box-shadow: var(--shadow-xs);
}

.system-note-card {
    padding: 20px 22px;
}

.system-note-card h6,
.system-stat-card h6 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
}

.system-note-card p,
.system-note-card li {
    color: var(--color-text-secondary);
}

.system-note-card ul {
    margin: 0;
    padding-left: 18px;
}

.system-note-card code {
    word-break: break-all;
}

.system-mobile-list {
    display: none;
    padding: 0 18px 18px;
}

.system-record-card {
    padding: 18px;
    border: 1px solid var(--color-border-light);
    border-radius: 18px;
    background: rgba(248, 251, 255, 0.82);
}

.system-record-card + .system-record-card {
    margin-top: 14px;
}

.system-record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

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

.system-record-cell {
    padding: 12px 14px;
    border: 1px solid var(--color-border-light);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
}

.system-record-cell strong {
    display: block;
    margin-top: 4px;
    color: var(--color-text);
    word-break: break-word;
}

.system-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.system-config-group + .system-config-group {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--color-border-light);
}

.system-config-group h6 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.system-config-badge {
    min-width: 76px;
    text-align: center;
}

.system-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.system-form-actions .btn {
    min-width: 120px;
}

.system-edit-table td {
    vertical-align: top;
}

.system-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.system-cell-stack .item-meta {
    margin-top: 0;
}

.system-edit-table .form-control,
.system-edit-table .form-select {
    width: 100%;
}

.system-inline-switch {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.system-row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.system-row-actions .btn {
    min-width: 88px;
}

.system-empty-select-note {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--color-text-muted);
    font-size: 12px;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--color-border);
}

.summary-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

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

.empty-state i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    border-radius: 24px;
    background: var(--color-primary-subtle);
    color: var(--color-primary);
    font-size: 28px;
}

.alert {
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: var(--shadow-xs);
    padding: 14px 16px;
}

.dropdown-menu {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 8px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
}

.dropdown-item {
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
}

.dropdown-item:hover {
    background: var(--color-surface-muted);
}

.pagination {
    gap: 6px;
}

.pagination .page-link {
    border-radius: 12px;
    border-color: var(--color-border);
    color: var(--color-text-secondary);
    padding: 7px 12px;
    font-size: 12px;
}

.pagination .page-item.active .page-link {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16);
}

.batch-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--color-border-light);
    background: rgba(248, 251, 255, 0.82);
}

.batch-bar.show {
    display: flex;
}

.batch-count {
    color: var(--color-primary);
    font-weight: 700;
}

.batch-bar-top {
    margin: 0 22px 16px;
    padding: 14px 16px;
    border: 1px solid var(--color-border-light);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(240, 246, 255, 0.9));
}

.batch-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.batch-actions-group .form-select {
    width: 240px;
}

.shadow-sm {
    box-shadow: var(--shadow-xs) !important;
}

.shadow {
    box-shadow: var(--shadow-sm) !important;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 1200px) {
    .page-shell {
        padding: 20px;
    }

    .page-header {
        padding: 22px;
    }
}

@media (max-width: 992px) {
    .app-sidebar {
        width: 78px;
    }

    .app-main.authenticated {
        margin-left: 78px;
    }

    .brand-copy,
    .menu-text,
    .sidebar-section-label,
    .sidebar-footer {
        display: none;
    }

    .app-sidebar .nav-link {
        justify-content: center;
    }

    .app-sidebar .sidebar-submenu,
    .submenu-arrow {
        display: none !important;
    }

    .app-topbar {
        padding: 16px 18px;
    }

    .topbar-title {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        width: 272px;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    .brand-copy,
    .menu-text,
    .sidebar-section-label,
    .sidebar-footer {
        display: revert !important;
    }

    .app-sidebar .nav-link {
        justify-content: flex-start;
    }

    .app-sidebar .sidebar-submenu,
    .submenu-arrow {
        display: revert !important;
    }

    .app-main.authenticated,
    .sidebar-collapsed .app-main.authenticated {
        margin-left: 0;
    }

    body.sidebar-mobile-open .app-sidebar {
        transform: translateX(0);
        box-shadow: var(--shadow-md);
    }

    body.sidebar-mobile-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .page-shell {
        padding: 16px;
    }

    .page-header,
    .app-topbar,
    .batch-bar,
    .page-actions,
    .topbar-right {
        flex-wrap: wrap;
    }

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

    .filter-panel-compact {
        padding: 16px 18px;
    }

    .filter-primary-row,
    .filter-primary-row.filter-primary-row-wide,
    .filter-advanced-row {
        grid-template-columns: 1fr;
    }

    .filter-actions-inline {
        justify-content: stretch;
    }

    .filter-actions-inline .btn,
    .filter-actions-inline a {
        flex: 1 1 auto;
    }

    .batch-bar-top {
        margin: 0 16px 16px;
    }

    .batch-actions-group {
        width: 100%;
    }

    .batch-actions-group .form-select,
    .batch-actions-group .btn {
        flex: 1 1 100%;
        width: 100%;
    }

    .topbar-left,
    .topbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .topbar-context {
        min-width: 0;
    }

    .topbar-title {
        font-size: 17px;
    }

    .hero-metrics,
    .info-grid,
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .editor-side-card {
        position: static;
    }

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

    .system-mobile-list {
        display: block;
    }

    .system-record-grid {
        grid-template-columns: 1fr;
    }

.table-responsive {
    font-size: 12px;
}
}

.level-badge-bronze {
    background: linear-gradient(135deg, #a16207, #d97706);
    color: #fff;
}

.level-badge-silver {
    background: linear-gradient(135deg, #94a3b8, #cbd5e1);
    color: #0f172a;
}

.level-badge-gold {
    background: linear-gradient(135deg, #d97706, #facc15);
    color: #422006;
}

.level-badge-platinum {
    background: linear-gradient(135deg, #64748b, #cbd5e1);
    color: #fff;
}

.level-badge-diamond {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #fff;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.1), transparent 24%),
        linear-gradient(180deg, #f7f9fc 0%, #f3f6fb 100%);
}

.auth-shell {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(360px, 420px);
    align-items: stretch;
    border: 1px solid var(--color-border);
    border-radius: 32px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(22px);
}

.auth-hero {
    position: relative;
    padding: 56px 48px;
    background:
        radial-gradient(circle at top left, rgba(90, 117, 255, 0.22), transparent 34%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 30%),
        linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(240, 246, 255, 0.96));
    color: var(--color-text);
}

.auth-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.46), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.auth-hero > * {
    position: relative;
    z-index: 1;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.auth-brand-mark {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.98), rgba(14, 165, 233, 0.9));
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.22);
    font-size: 24px;
    color: #ffffff;
}

.auth-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-brand-copy strong {
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.auth-brand-copy span {
    color: var(--color-text-secondary);
    font-size: 14px;
}

.auth-hero h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 40px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.auth-hero p {
    margin: 16px 0 0;
    max-width: 420px;
    color: var(--color-text-secondary);
    font-size: 15px;
}

.auth-points {
    margin: 34px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(217, 226, 239, 0.82);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    color: var(--color-text-secondary);
}

.auth-points i {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--color-primary-subtle);
    color: var(--color-primary);
    flex: 0 0 auto;
}

.auth-panel {
    padding: 40px 36px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
    border-left: 1px solid rgba(217, 226, 239, 0.82);
}

.auth-panel-head {
    margin-bottom: 24px;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--color-primary-subtle);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
}

.auth-panel-head h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.auth-panel-head p {
    margin: 8px 0 0;
    color: var(--color-text-secondary);
}

.auth-panel .input-group-text {
    background: rgba(248, 251, 255, 0.92);
    border-color: var(--color-border);
    color: var(--color-text-muted);
    border-radius: 14px 0 0 14px;
    min-width: 46px;
    justify-content: center;
}

.auth-panel .form-control {
    border-color: var(--color-border);
    min-height: 46px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 0 14px 14px 0;
}

.auth-panel .form-control:focus {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.auth-panel .input-group .form-control:not(:focus) {
    box-shadow: none;
}

.auth-panel .form-label {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.auth-submit {
    min-height: 48px;
    border-radius: 14px;
    font-weight: 700;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.16);
}

.auth-captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.auth-captcha-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-captcha-image {
    height: 46px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
}

.auth-panel .alert {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.94));
}

.contact-meta-card .summary-item {
    align-items: flex-start;
    gap: 12px;
}

.contact-meta-card .summary-item strong {
    text-align: right;
}

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

    .auth-hero,
    .auth-panel {
        padding: 32px 24px;
    }
}

@media (max-width: 576px) {
    .auth-page {
        padding: 16px;
    }

    .auth-shell {
        border-radius: 24px;
    }

    .auth-captcha-row {
        grid-template-columns: 1fr;
    }

    .auth-captcha-box {
        justify-content: space-between;
    }
}

body {
    background:
        radial-gradient(circle at top left, rgba(112, 141, 255, 0.08), transparent 30%),
        linear-gradient(180deg, #f6f7fb 0%, #f3f5fb 100%);
}

body,
button,
input,
select,
textarea {
    font-family: "Inter", "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.metric-value,
.stat-value,
.editor-highlight,
.dashboard-hero-stat-value,
.dashboard-metric-value,
.dashboard-chart-kpi-value,
.dashboard-rank-value,
.topbar-title,
.page-header h4,
.table td,
.badge,
.btn,
.form-control,
.form-select {
    font-feature-settings: "tnum" 1, "lnum" 1;
    font-variant-numeric: tabular-nums lining-nums;
}

.app-sidebar {
    width: 258px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 251, 255, 0.96));
    color: #7a819b;
    border-right: 1px solid #ebeef7;
    box-shadow: 18px 0 48px rgba(112, 121, 165, 0.05);
}

.sidebar-header {
    height: 84px;
    padding: 22px 20px 16px;
    border-bottom: 1px solid #f0f2f8;
}

.sidebar-brand {
    gap: 14px;
    color: var(--color-text);
}

.brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    background: linear-gradient(180deg, #6a85ff 0%, #5872f3 100%);
    box-shadow: 0 14px 32px rgba(88, 114, 243, 0.22);
}

.brand-mark i {
    font-size: 20px;
}

.brand-text {
    font-size: 16px;
    color: #1d2438;
}

.brand-subtext {
    color: #97a0bb;
}

.sidebar-menu {
    height: calc(100vh - 84px - 76px);
    padding: 18px 14px;
}

.sidebar-section-label {
    padding: 8px 12px 10px;
    color: #717b99;
    letter-spacing: 0.08em;
}

.app-sidebar .nav-link {
    gap: 12px;
    margin-bottom: 6px;
    padding: 11px 14px;
    color: #414d6b;
    border-radius: 16px;
}

.app-sidebar .nav-link i {
    color: #55617f;
}

.app-sidebar .nav-link:hover {
    background: #f4f6ff;
    color: #394565;
    transform: none;
}

.app-sidebar .nav-link.active {
    background: linear-gradient(180deg, #edf1ff 0%, #f4f7ff 100%);
    color: #3657d6;
    box-shadow: inset 0 0 0 1px #e4eaff;
}

.app-sidebar .nav-link.active i,
.app-sidebar .nav-link:hover i {
    color: inherit;
}

.app-sidebar .nav-link.active::before {
    left: 8px;
    top: 12px;
    bottom: 12px;
    width: 4px;
    background: linear-gradient(180deg, #6c86ff 0%, #91a7ff 100%);
}

.sidebar-submenu {
    padding: 6px 0 0 30px;
}

.sidebar-submenu-link {
    color: #4f5b78;
    border-radius: 14px;
}

.sidebar-submenu-link:hover {
    background: #f5f7fd;
    color: #40507a;
}

.sidebar-submenu-link.active {
    background: #eef2ff;
    color: #3657d6;
}

.sidebar-footer {
    height: 76px;
    padding: 16px 20px 20px;
    border-top: 1px solid #f0f2f8;
    background: rgba(255, 255, 255, 0.9);
}

.sidebar-user-role {
    color: #717b99;
}

.sidebar-user-name {
    color: #20283d;
    font-size: 14px;
}

.app-main.authenticated {
    margin-left: 258px;
}

.app-topbar {
    padding: 18px 24px;
    background: rgba(246, 247, 251, 0.88);
    border-bottom: 1px solid #ebeef7;
    backdrop-filter: blur(16px);
}

.topbar-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border-color: #e9edf8;
    background: rgba(255, 255, 255, 0.92);
}

.topbar-eyebrow {
    color: #a2aac1;
}

.topbar-title {
    font-size: 22px;
    color: #1f2537;
}

.topbar-cta {
    padding-inline: 18px;
}

.topbar-user {
    min-height: 40px;
    padding-inline: 12px 14px;
    border-color: #e9edf8;
    background: rgba(255, 255, 255, 0.92);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: #eef2ff;
    color: #5573ff;
}

.page-shell {
    padding: 24px;
}

.page-header {
    margin-bottom: 18px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.page-header h4 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.page-header p {
    margin-top: 6px;
    max-width: 720px;
    color: #7c849f;
}

.page-kicker {
    margin-bottom: 12px;
    padding: 7px 12px;
    background: #eef2ff;
    color: #5573ff;
    letter-spacing: 0.04em;
}

.card {
    border: 1px solid #eaedf6;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 36px rgba(88, 97, 140, 0.05);
    backdrop-filter: none;
}

.card:hover {
    border-color: #e2e7f5;
    box-shadow: 0 16px 40px rgba(88, 97, 140, 0.08);
}

.card-header {
    padding: 20px 22px;
    border-bottom: 1px solid #f0f2f8;
    border-radius: 24px 24px 0 0 !important;
    background: transparent;
}

.card-body {
    padding: 22px;
}

.filter-panel,
.filter-bar,
.summary-panel,
.metric-card,
.detail-block,
.info-tile,
.activity-item,
.editor-soft-block,
.system-note-card,
.system-stat-card,
.system-record-card {
    border-color: #eaedf6;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 30px rgba(88, 97, 140, 0.04);
}

.filter-panel,
.filter-bar {
    border-radius: 24px;
}

.table-toolbar {
    padding: 20px 22px 0;
}

.table-toolbar h6 {
    font-size: 15px;
}

.table th {
    padding: 12px 16px;
    color: #929ab3;
    border-bottom: 1px solid #eef1f7;
    background: transparent;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid #f2f4fa;
}

.table-hover > tbody > tr:hover > * {
    background: #f8faff;
}

.item-title {
    font-size: 14px;
}

.item-meta {
    color: #98a0b8;
}

.badge {
    padding: 7px 12px;
    font-size: 11px;
}

.btn {
    border-radius: 14px;
    padding: 8px 16px;
}

.btn-primary {
    border-color: #5a75ff;
    background: linear-gradient(180deg, #6984ff 0%, #5872f3 100%);
    box-shadow: 0 12px 24px rgba(88, 114, 243, 0.18);
}

.btn-primary:hover {
    border-color: #4d67ea;
    background: linear-gradient(180deg, #5f79ff 0%, #4d67ea 100%);
}

.btn-light {
    color: #5f6884;
    border-color: #e7ebf5;
    background: rgba(255, 255, 255, 0.96);
}

.btn-light:hover {
    color: #2d3550;
    border-color: #dfe4f1;
    background: #ffffff;
}

.form-control,
.form-select {
    min-height: 46px;
    border-color: #e5e9f3;
    background: #fbfcff;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(90, 117, 255, 0.58);
    box-shadow: 0 0 0 4px rgba(90, 117, 255, 0.1);
}

.empty-state {
    color: #8f97b1;
}

.empty-state i {
    background: #eef2ff;
    color: #5a75ff;
}

.dropdown-menu {
    border-color: #eaedf6;
    box-shadow: 0 18px 42px rgba(88, 97, 140, 0.12);
    background: rgba(255, 255, 255, 0.98);
}

.dropdown-item:hover {
    background: #f6f8ff;
}

.batch-bar {
    background: #fafbff;
}

.batch-bar-top {
    border-color: #ebeff7;
    background: #fafbff;
}

.pagination .page-link {
    border-color: #e6eaf4;
    background: #ffffff;
}

.pagination .page-item.active .page-link {
    border-color: #5a75ff;
    background: #5a75ff;
    box-shadow: 0 10px 22px rgba(88, 114, 243, 0.16);
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(140, 149, 184, 0.22);
}

@media (max-width: 992px) {
    .app-sidebar {
        width: 78px;
    }

    .app-main.authenticated {
        margin-left: 78px;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        width: 258px;
    }

    .app-topbar {
        padding: 16px 18px;
    }

    .page-shell {
        padding: 18px;
    }
}

.page-header {
    align-items: flex-end;
    gap: 20px;
}

.page-actions {
    gap: 12px;
}

.page-actions .btn,
.table td .btn,
.table td form {
    white-space: nowrap;
}

.page-header .badge {
    border-color: #e4e8f3 !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: #63708c !important;
}

.filter-panel,
.filter-bar {
    position: relative;
    overflow: visible;
    z-index: 20;
}

.filter-panel::before,
.filter-bar::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 72px;
    background: linear-gradient(180deg, rgba(97, 122, 255, 0.05), rgba(97, 122, 255, 0));
    pointer-events: none;
}

.filter-panel > *,
.filter-bar > * {
    position: relative;
    z-index: 1;
}

.ts-wrapper {
    width: 100%;
}

.ts-dropdown {
    z-index: 1080;
}

.filter-panel .form-select,
.filter-bar .form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%238b96b4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px 14px;
}

.filter-panel .form-select:focus,
.filter-bar .form-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%235a75ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.filter-compact-field .form-control::placeholder {
    color: #adb4c8;
}

.filter-advanced-row {
    padding-top: 18px;
    border-top-style: solid;
    border-top-color: #edf0f7;
}

.filter-actions-inline .btn,
.filter-actions-inline a {
    min-width: 92px;
}

.table-toolbar {
    align-items: flex-end;
}

.table-toolbar small {
    display: block;
    max-width: 480px;
    line-height: 1.6;
    color: #97a0b8;
}

.table-responsive {
    border-radius: 0 0 24px 24px;
}

.table th:first-child,
.table td:first-child {
    padding-left: 18px;
}

.table th:last-child,
.table td:last-child {
    padding-right: 18px;
}

.table td .btn + .btn,
.table td .btn + form,
.table td form + .btn,
.table td form + form {
    margin-left: 6px;
}

.table td form {
    display: inline-flex;
}

.status-badge {
    min-width: 74px;
    padding-inline: 10px;
    border-radius: 999px;
}

.hero-metrics {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.metric-card {
    position: relative;
    padding: 20px;
    border: 1px solid #e8ecf6;
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(104, 125, 255, 0.08), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 251, 255, 0.96));
}

.metric-label {
    color: #9098b1;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.metric-value {
    margin-top: 10px;
    font-size: 28px;
    color: #1f2537;
}

.metric-note {
    margin-top: 8px;
    color: #8e97b0;
}

.section-stack {
    gap: 20px;
}

.info-grid {
    gap: 16px;
}

.info-tile {
    min-height: 94px;
    border-radius: 20px;
    border-color: #e9edf6;
    box-shadow: 0 10px 24px rgba(88, 97, 140, 0.04);
}

.detail-block {
    border-radius: 20px;
    border-color: #e9edf6;
}

.summary-panel {
    border-radius: 24px;
    padding: 22px;
}

.summary-panel h6 {
    font-size: 15px;
    font-weight: 700;
    color: #21283d;
}

.summary-item {
    align-items: flex-start;
}

.summary-item span {
    color: #8f97b0;
}

.summary-item strong {
    color: #20283d;
    text-align: right;
}

.editor-layout {
    grid-template-columns: minmax(0, 1.72fr) minmax(310px, 0.92fr);
    gap: 22px;
    align-items: start;
}

.editor-layout > .card,
.editor-layout .editor-side-card {
    border-radius: 26px;
}

.editor-layout .card-header {
    padding-bottom: 16px;
}

.editor-layout .card-header h6,
.editor-section h6 {
    color: #20283d;
}

.editor-section + .editor-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top-color: #edf0f7;
}

.editor-soft-block {
    border-radius: 20px;
}

.editor-helper,
.form-text {
    color: #97a0b8;
    font-size: 12px;
    line-height: 1.6;
}

.editor-highlight {
    font-size: 30px;
    color: #20283d;
}

.form-control.bg-light,
.form-select.bg-light,
.form-control-plaintext {
    border-radius: 14px;
}

.empty-state {
    padding: 60px 24px;
}

.empty-state h6 {
    font-size: 16px;
    color: #20283d;
}

.alert {
    border-radius: 18px;
}

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

/* =============================================
   MOBILE REDESIGN — 千牛风格：紧凑、精简、高效
   ============================================= */

/* ---- Bottom Navigation Bar (always rendered, shown via media query) ---- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(180deg, var(--color-sidebar-bg) 0%, var(--color-sidebar-bg-soft) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1050;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--color-sidebar-text);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    padding: 6px 2px;
    position: relative;
}

.mobile-nav-item i { font-size: 18px; line-height: 1; }

.mobile-nav-item.active { color: #fff; }

.mobile-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 2px;
    border-radius: 0 0 3px 3px;
    background: var(--color-primary);
}

/* ---- All mobile rules ---- */
@media (max-width: 768px) {

    /* === Foundation === */
    body.authenticated-body {
        padding-bottom: calc(56px + env(safe-area-inset-bottom));
        font-size: 13px;
    }

    .app-main.authenticated,
    .sidebar-collapsed .app-main.authenticated {
        margin-left: 0 !important;
    }

    .mobile-bottom-nav {
        display: flex;
        align-items: stretch;
    }

    /* === Topbar — thin title bar === */
    .app-topbar {
        position: sticky;
        top: 0;
        z-index: 1030;
        padding: 8px 12px;
        min-height: 44px;
        gap: 6px;
    }

    .topbar-eyebrow { display: none; }

    .topbar-title { font-size: 15px !important; }

    .topbar-right { gap: 4px !important; }

    .topbar-right .dropdown-toggle.topbar-cta {
        padding: 4px 10px;
        font-size: 12px;
        min-height: 32px;
    }

    .topbar-user > span:last-child { display: none; }

    .topbar-icon-btn {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    /* === Page shell === */
    .page-shell {
        padding: 10px 12px 1.5rem;
    }

    .card {
        border-radius: 8px;
    }

    /* === Page header === */
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 12px 14px !important;
        border-radius: 8px !important;
        gap: 6px;
    }

    .page-header h4,
    .page-header .page-kicker {
        font-size: 13px !important;
    }

    .page-header p {
        font-size: 11px;
    }

    .page-header .page-actions {
        width: 100%;
    }

    /* === Filter panel === */
    .filter-panel-compact {
        border-radius: 8px;
        padding: 10px 12px;
    }

    .filter-primary-row,
    .filter-primary-row.filter-primary-row-wide,
    .filter-advanced-row {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    .form-label { font-size: 11px; margin-bottom: 2px; }

    .filter-actions-inline .btn { font-size: 12px; }

    /* === Form elements — prevent iOS zoom === */
    .form-control,
    .form-select {
        font-size: 16px !important;
        min-height: 38px;
        padding: 6px 10px;
        border-radius: 6px;
    }

    .ts-wrapper .ts-control {
        min-height: 38px;
        font-size: 16px !important;
    }

    .btn { min-height: 34px; font-size: 13px; }

    .btn-sm { min-height: 30px; font-size: 12px; padding: 4px 10px; }

    /* === Table toolbar === */
    .table-toolbar {
        padding: 10px 12px;
    }

    .table-toolbar h6 { font-size: 13px; }

    .table-toolbar small { font-size: 11px; }

    .customer-toolbar-meta,
    .lead-toolbar-meta,
    .opportunity-toolbar-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    /* === Table → Compact Card List === */
    .mobile-cards-view .table-responsive {
        overflow: visible;
    }

    .mobile-cards-view .table-responsive table {
        display: block;
        min-width: unset !important;
        width: 100% !important;
        background: transparent;
        border: none;
    }

    .mobile-cards-view .table-responsive thead {
        display: none;
    }

    .mobile-cards-view .table-responsive tbody {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 0 12px 12px;
    }

    .mobile-cards-view .table-responsive tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0;
        background: var(--color-surface-solid);
        border: 1px solid var(--color-border-light);
        border-radius: 8px;
        padding: 10px 12px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    }

    /* Hide checkbox + expand columns */
    .mobile-cards-view .table-responsive td:first-child,
    .mobile-cards-view td.order-expand-col {
        display: none !important;
    }

    /* Default: hide all cells */
    .mobile-cards-view .table-responsive td {
        display: none;
        border: none !important;
        background: transparent !important;
        padding: 0;
        font-size: 12px;
        line-height: 1.4;
    }

    /* Title cell — always show, full width */
    .mobile-cards-view .table-responsive td[data-label=""] {
        display: block;
        width: 100%;
        padding-bottom: 4px;
        margin-bottom: 6px;
        border-bottom: 1px solid var(--color-border-light) !important;
    }

    .mobile-cards-view td[data-label=""]::before { display: none; }

    .mobile-cards-view td[data-label=""] .item-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--color-text);
    }

    .mobile-cards-view td[data-label=""] .item-meta {
        font-size: 11px;
        color: var(--color-text-muted);
        margin-top: 1px;
    }

    /* Visible key fields — only essentials */
    /* 客户: 状态 + 等级 */
    .mobile-cards-view td[data-label="状态"],
    .mobile-cards-view td[data-label="等级"],
    /* 线索: 意向 */
    .mobile-cards-view td[data-label="意向"],
    /* 商机: 阶段 + 预计金额 */
    .mobile-cards-view td[data-label="阶段"],
    .mobile-cards-view td[data-label="预计金额"],
    /* 订单: 客户 + 金额 + 日期 */
    .mobile-cards-view td[data-label="客户"],
    .mobile-cards-view td[data-label="金额"],
    .mobile-cards-view td[data-label="日期"],
    /* 移动端保留业务归属与跟进上下文，避免只能看到名称和状态 */
    .mobile-cards-view td[data-label="渠道"],
    .mobile-cards-view td[data-label="负责人"],
    .mobile-cards-view td[data-label="销售"],
    .mobile-cards-view td[data-label="最近跟进"] {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin-right: 6px;
        margin-bottom: 4px;
    }

    .mobile-cards-view .table-responsive td[data-label]::before {
        content: attr(data-label) ":";
        font-size: 11px;
        font-weight: 500;
        color: var(--color-text-muted);
        white-space: nowrap;
    }

    .mobile-cards-view td[data-label=""]::before,
    .mobile-cards-view td[data-label="操作"]::before {
        display: none;
    }

    /* Order number — show as title style */
    .mobile-cards-view td[data-label="订单号"] {
        display: block;
        width: 100%;
        margin-right: 0;
        padding-bottom: 4px;
        margin-bottom: 6px;
        border-bottom: 1px solid var(--color-border-light) !important;
        font-size: 14px;
        font-weight: 600;
    }

    .mobile-cards-view td[data-label="订单号"]::before { display: none; }

    .mobile-cards-view td[data-label="订单号"] .item-title {
        font-weight: 600;
    }

    /* Action cell — full width bottom row */
    .mobile-cards-view td[data-label="操作"] {
        display: flex !important;
        width: 100%;
        justify-content: flex-end;
        gap: 6px;
        margin-top: 6px;
        padding-top: 8px;
        border-top: 1px solid var(--color-border-light) !important;
    }

    .mobile-cards-view td[data-label="操作"] .btn {
        padding: 3px 10px;
        font-size: 11px;
        min-height: 28px;
        border-radius: 6px;
    }

    .mobile-cards-view .customer-brief,
    .mobile-cards-view .lead-brief,
    .mobile-cards-view .opportunity-brief {
        gap: 0;
    }

    .mobile-cards-view .customer-brief strong,
    .mobile-cards-view .lead-brief strong,
    .mobile-cards-view .opportunity-brief strong {
        font-size: 12px;
        font-weight: 500;
    }

    /* Order items expand row */
    .mobile-cards-view .order-items-row {
        display: none !important;
    }

    /* Badges smaller */
    .mobile-cards-view .badge {
        font-size: 11px;
        padding: 2px 6px;
    }

    /* Batch bar */
    .mobile-cards-view .batch-bar,
    .batch-bar {
        flex-direction: column;
        gap: 6px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .mobile-cards-view .batch-bar .batch-actions-group {
        width: 100%;
        flex-wrap: wrap;
    }

    /* Filter chips */
    .customer-filter-chip,
    .lead-filter-chip,
    .customer-active-filters,
    .lead-active-filters {
        font-size: 11px;
        gap: 4px;
    }

    /* === Layouts === */
    .editor-layout,
    .info-grid {
        grid-template-columns: 1fr !important;
    }

    .editor-side-card { position: static !important; }

    .hero-metrics { grid-template-columns: repeat(2, 1fr) !important; }

    /* === Detail pages === */
    .detail-section { padding: 10px !important; }

    .detail-meta-grid { grid-template-columns: 1fr !important; }

    .info-card .card-body { padding: 10px 12px; }

    .tab-content .tab-pane { padding: 0; }

    /* === Pagination === */
    .pagination-bar {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 4px;
        font-size: 12px;
    }

    /* === Flash === */
    .flash-stack .alert {
        font-size: 12px;
        padding: 8px 12px;
        border-radius: 8px;
    }

    /* === Empty state === */
    .empty-state {
        padding: 30px 16px;
    }

    .empty-state h6 { font-size: 14px; }
    .empty-state div { font-size: 12px; }

    .empty-state i { font-size: 36px; }
}

/* ---- Mobile Tab Bar (订单等子页面切换) ---- */
.mobile-tab-bar {
    display: flex;
    gap: 0;
    background: var(--color-surface-solid);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    overflow: hidden;
}

.mobile-tab {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-right: 1px solid var(--color-border-light);
    transition: background 0.15s, color 0.15s;
}

.mobile-tab:last-child { border-right: none; }

.mobile-tab.active {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.mobile-tab:not(.active):hover {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

/* 992px: tablet sidebar collapse */
@media (max-width: 992px) {
    .app-main.authenticated {
        margin-left: 78px;
    }
}
/* OAuth consent is intentionally isolated from the authenticated CRM shell. */
.oauth-consent-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 50% 12%, rgba(99, 102, 241, 0.09), transparent 34rem),
        #f5f7fb;
    color: #172033;
}

.oauth-consent-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.oauth-consent-card {
    width: min(100%, 480px);
    padding: 36px;
    border: 1px solid #e4e8f1;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(36, 45, 78, 0.1);
}

.oauth-consent-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-bottom: 28px;
    color: #68728a;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.oauth-consent-brand-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    background: #6266f1;
    color: #fff;
    font-size: 14px;
}

.oauth-consent-icon {
    display: grid;
    width: 60px;
    height: 60px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 18px;
    background: #eef0ff;
    color: #6266f1;
    font-size: 29px;
}

.oauth-consent-heading {
    margin-bottom: 24px;
    text-align: center;
}

.oauth-consent-heading h1 {
    margin: 0 0 9px;
    color: #141b2d;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
}

.oauth-consent-heading p {
    margin: 0;
    color: #717b91;
    font-size: 14px;
}

.oauth-consent-heading p strong {
    color: #323b52;
    font-weight: 600;
}

.oauth-consent-account {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 13px 15px;
    border: 1px solid #e6e9f1;
    border-radius: 14px;
    background: #fafbfe;
}

.oauth-consent-account-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: #e9ebff;
    color: #6266f1;
}

.oauth-consent-account span:last-child {
    display: grid;
    gap: 1px;
}

.oauth-consent-account small {
    color: #8a93a7;
    font-size: 12px;
}

.oauth-consent-account strong {
    color: #252e43;
    font-size: 14px;
    font-weight: 650;
}

.oauth-consent-scope {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 15px;
    border: 1px solid #dce0ff;
    border-radius: 14px;
    background: #f6f7ff;
}

.oauth-consent-scope-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    background: #e5e7ff;
    color: #565bdc;
}

.oauth-consent-scope strong {
    display: block;
    margin-bottom: 4px;
    color: #303957;
    font-size: 14px;
}

.oauth-consent-scope p {
    margin: 0;
    color: #6f7890;
    font-size: 13px;
    line-height: 1.65;
}

.oauth-consent-form {
    display: grid;
    gap: 10px;
}

.oauth-consent-form .btn {
    min-height: 44px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
}

.oauth-consent-allow {
    border-color: #6266f1;
    background: #6266f1;
    box-shadow: 0 8px 20px rgba(98, 102, 241, 0.2);
}

.oauth-consent-allow:hover,
.oauth-consent-allow:focus {
    border-color: #5357dd;
    background: #5357dd;
}

.oauth-consent-deny {
    border-color: transparent;
    color: #667086;
    background: transparent;
}

.oauth-consent-deny:hover,
.oauth-consent-deny:focus {
    border-color: #e5e8ef;
    color: #343d52;
    background: #f7f8fb;
}

.oauth-consent-footnote {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 20px 0 0;
    color: #98a0b1;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 575.98px) {
    .oauth-consent-shell {
        padding: 18px 14px;
    }

    .oauth-consent-card {
        padding: 28px 20px;
        border-radius: 18px;
    }

    .oauth-consent-brand {
        margin-bottom: 24px;
    }

    .oauth-consent-heading h1 {
        font-size: 23px;
    }
}
.crm-toast-stack {
    position: fixed;
    top: 78px;
    right: 22px;
    z-index: 1090;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
}

.crm-toast {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    color: #26304a;
    background: #fff;
    border: 1px solid #e5e9f3;
    border-left: 4px solid #6476ff;
    border-radius: 12px;
    box-shadow: 0 14px 38px rgba(32, 45, 85, .16);
    opacity: 0;
    transform: translateY(-8px);
    transition: .18s ease;
}

.crm-toast.show { opacity: 1; transform: translateY(0); }
.crm-toast-success { border-left-color: #20a56a; }
.crm-toast-danger { border-left-color: #dc4c64; }
.crm-toast button { border: 0; background: transparent; color: #7a849b; }

.crm-confirm-card { border: 0; border-radius: 18px; box-shadow: 0 24px 70px rgba(30, 40, 75, .22); }
.crm-confirm-card .modal-body { padding: 28px 24px 12px; text-align: center; }
.crm-confirm-card .modal-footer { justify-content: center; border: 0; padding: 10px 24px 24px; }
.crm-confirm-icon {
    display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 14px;
    color: #5667f5; background: #eef0ff; border-radius: 50%; font-size: 20px;
}
.crm-confirm-card p { margin: 8px 0 0; color: #6e7890; line-height: 1.6; }

.sticky-form-actions {
    position: sticky;
    bottom: 14px;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid #e4e8f2;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(37, 49, 89, .12);
    backdrop-filter: blur(10px);
}

.system-config-tools { width: min(320px, 45vw); }
.system-config-nav { display: grid; gap: 6px; }
.system-config-nav a {
    padding: 8px 10px; color: #58647d; text-decoration: none; border-radius: 8px;
}
.system-config-nav a:hover { color: #4f60ed; background: #f2f4ff; }
.system-config-group { scroll-margin-top: 84px; }
.system-config-group + .system-config-group { margin-top: 24px; }
.editor-side-card { position: sticky; top: 82px; }

.order-context-summary {
    margin-bottom: 20px;
    padding: 10px 14px;
    border: 1px solid #e6eaf3;
    border-radius: 12px;
    background: #fafbfe;
}
.order-context-summary summary { color: #64708a; font-size: 13px; cursor: pointer; }
.order-context-summary[open] summary { margin-bottom: 12px; }

/* 工作台首屏保持紧凑：关键指标与趋势优先，说明信息按需下沉。 */
.dashboard-overview-panel .card-body,
.dashboard-todo-panel .card-body { padding: 22px !important; }
.dashboard-overview-chart { margin-top: 18px !important; padding: 18px !important; }
.dashboard-echart { height: 250px !important; min-height: 250px !important; }
.dashboard-overview-brief { display: none !important; }

@media (max-width: 768px) {
    .dashboard-overview-panel .card-body,
    .dashboard-todo-panel .card-body { padding: 16px !important; }
    .dashboard-echart { height: 210px !important; min-height: 210px !important; }
    .editor-side-card { position: static; }
}

/* 无顶部栏布局：导航、账号与辅助入口均归入侧栏。 */
.app-sidebar { overflow: visible; }
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-brand { min-width: 0; flex: 1; }

.sidebar-collapse-btn {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #7b849d;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
}

.sidebar-collapse-btn:hover,
.sidebar-collapse-btn:focus-visible {
    color: #5065e8;
    background: #f1f3fb;
    border-color: #e8ebf4;
}

.sidebar-footer { height: auto !important; padding: 10px 12px 14px !important; }
.sidebar-account {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 8px;
    color: #293149;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 11px;
}
.sidebar-account:hover,
.sidebar-account[aria-expanded="true"] { background: #f3f5fa; }
.sidebar-account-avatar {
    display: grid; place-items: center; width: 34px; height: 34px;
    color: #5369ee; background: #edf0ff; border-radius: 50%;
}
.sidebar-account-copy { display: flex; min-width: 0; flex-direction: column; }
.sidebar-account-copy .sidebar-user-name,
.sidebar-account-copy .sidebar-user-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account-more { color: #9aa2b7; }
.sidebar-account-menu { min-width: 210px; margin: 0 8px 8px !important; }

.sidebar-collapsed .sidebar-header { padding-inline: 12px !important; justify-content: center; }
.sidebar-collapsed .sidebar-brand { display: none; }
.sidebar-collapsed .sidebar-collapse-btn { display: grid; }
.sidebar-collapsed .sidebar-footer { display: block !important; padding-inline: 10px !important; }
.sidebar-collapsed .sidebar-account { display: flex; justify-content: center; padding-inline: 0; }
.sidebar-collapsed .sidebar-account-copy,
.sidebar-collapsed .sidebar-account-more { display: none; }
.sidebar-collapsed .sidebar-account-menu { margin-left: 58px !important; }

@media (max-width: 768px) {
    .sidebar-collapse-btn { display: none; }
}

@media (max-width: 768px) {
    .crm-toast-stack { top: 14px; right: 16px; }
    .page-header { gap: 12px; }
    .page-header p { display: none; }
    .page-actions { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .page-actions .btn { flex: 0 0 auto; }
    .sticky-form-actions { bottom: 76px; }
}

/* 克制的语义状态色：浅底、深字、低饱和边框，减少后台页面的视觉噪音。 */
.badge.bg-success,
.badge.bg-success-subtle {
    color: #416b57 !important;
    background: #e8f2ec !important;
    border: 1px solid #d5e5dc;
}

.badge.bg-warning,
.badge.bg-warning-subtle {
    color: #78652f !important;
    background: #f5f0df !important;
    border: 1px solid #e8dfc2;
}

.badge.bg-danger,
.badge.bg-danger-subtle {
    color: #85515a !important;
    background: #f5e9eb !important;
    border: 1px solid #e9d5d9;
}

.badge.bg-info,
.badge.bg-info-subtle {
    color: #4e7080 !important;
    background: #e8f0f4 !important;
    border: 1px solid #d5e3e9;
}

.badge.bg-primary,
.badge.bg-primary-subtle {
    color: #53638a !important;
    background: #ebeff7 !important;
    border: 1px solid #dce2ef;
}

.badge.bg-secondary {
    color: #687185 !important;
    background: #eef0f4 !important;
    border: 1px solid #dfe3ea;
}

.level-badge-bronze {
    color: #755b3c !important;
    background: #f0e8de !important;
    border: 1px solid #e2d5c5;
}
.level-badge-silver {
    color: #657083 !important;
    background: #edf0f4 !important;
    border: 1px solid #dde2e9;
}
.level-badge-gold {
    color: #806b32 !important;
    background: #f4eedc !important;
    border: 1px solid #e6dcc0;
}
.level-badge-platinum,
.level-badge-diamond {
    color: #536b7b !important;
    background: #e8eff3 !important;
    border: 1px solid #d6e1e7;
}

/* 企业级列表约束：筛选和行操作在可用宽度内重排，不越过卡片边界。 */
.team-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) repeat(4, minmax(145px, 1fr)) auto;
    align-items: end;
    gap: 14px;
}
.team-filter-grid > * { min-width: 0; }
.filter-action-group,
.table-action-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.filter-action-group { justify-content: flex-end; }
.filter-action-group .btn { flex: 0 0 auto; }
.table-action-group { justify-content: center; flex-wrap: wrap; }
.table-action-group .btn { margin: 0 !important; }
.enterprise-action-cell {
    width: 1%;
    min-width: 170px;
    white-space: nowrap;
}
.batch-channel-select {
    width: min(240px, 100%);
    flex: 1 1 190px;
    min-width: 160px;
}
.batch-bar {
    max-width: calc(100% - 24px);
    flex-wrap: wrap;
}
.purchase-secondary-col { display: none; }

.opportunity-stage-badge {
    color: #53638a !important;
    background: #ebeff7 !important;
    border-color: #dce2ef !important;
}
.dashboard-trend-badge.positive {
    color: #416b57 !important;
    background: #e8f2ec !important;
}
.dashboard-trend-badge.negative {
    color: #85515a !important;
    background: #f5e9eb !important;
}
.dashboard-trend-badge.neutral {
    color: #687185 !important;
    background: #eef0f4 !important;
}

.order-customer-link {
    color: #33466f;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed #bdc6da;
}
.order-customer-link:hover {
    color: #5268df;
    border-bottom-color: #5268df;
}

/* 企业经营驾驶舱：指标横向总览，趋势与待办形成主从工作区。 */
.dashboard-command-grid {
    display: contents;
}
.dashboard-clean-shell .dashboard-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 2fr) minmax(340px, .85fr) !important;
    align-items: start;
    gap: 16px !important;
}
.dashboard-command-grid .dashboard-overview-panel {
    display: contents;
}
.dashboard-command-grid .dashboard-overview-panel > .card-body {
    display: contents;
}
.dashboard-command-grid .dashboard-overview-header {
    grid-column: 1 / -1;
    padding: 0 2px 2px;
}
.dashboard-command-grid .dashboard-overview-kpis {
    grid-column: 1 / -1;
    gap: 10px;
}
.dashboard-command-grid .dashboard-overview-kpi {
    min-height: 116px;
    padding: 16px;
    border: 1px solid #e5e9f1;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
}
.dashboard-command-grid .dashboard-overview-kpi:hover {
    border-color: #cfd7e8;
    transform: translateY(-1px);
}
.dashboard-command-grid .dashboard-overview-chart {
    grid-column: 1;
    margin-top: 0 !important;
    border: 1px solid #e5e9f1;
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
}
.dashboard-command-grid .dashboard-todo-panel {
    grid-column: 2;
    min-width: 0;
    border: 1px solid #e5e9f1;
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
    max-height: 620px;
    overflow: hidden;
}
.dashboard-command-grid .dashboard-todo-panel > .card-body {
    height: 100%;
    padding: 18px !important;
    overflow-y: auto;
}
.dashboard-command-grid .dashboard-todo-levels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
.dashboard-command-grid .dashboard-todo-level {
    border-radius: 10px;
    box-shadow: none;
}
.dashboard-command-grid .dashboard-todo-note {
    max-width: 250px;
}
.dashboard-ranking-grid {
    margin-top: 18px;
    gap: 12px !important;
}
.dashboard-ranking-grid .dashboard-block {
    border-radius: 12px !important;
    box-shadow: none !important;
}

@media (max-width: 1180px) {
    .dashboard-clean-shell .dashboard-hero { grid-template-columns: 1fr !important; }
    .dashboard-command-grid .dashboard-overview-header,
    .dashboard-command-grid .dashboard-overview-kpis,
    .dashboard-command-grid .dashboard-overview-chart,
    .dashboard-command-grid .dashboard-todo-panel { grid-column: 1; }
    .dashboard-command-grid .dashboard-todo-panel { max-height: none; }
    .dashboard-command-grid .dashboard-todo-levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .dashboard-command-grid .dashboard-todo-levels { grid-template-columns: 1fr; }
    .dashboard-command-grid .dashboard-overview-kpi { min-height: auto; }
}

.page-header > * { min-width: 0; }
.page-header .page-actions {
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.filter-panel form > *,
.filter-bar form > * { min-width: 0; }
.table-responsive {
    scrollbar-gutter: stable;
    overscroll-behavior-inline: contain;
}
.table td .badge {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.item-title,
.item-meta { overflow-wrap: anywhere; }

@media (max-width: 1400px) {
    .team-filter-grid {
        grid-template-columns: minmax(240px, 2fr) repeat(2, minmax(170px, 1fr));
    }
    .filter-action-group { justify-content: flex-start; }
}

@media (max-width: 768px) {
    .team-filter-grid { grid-template-columns: 1fr; gap: 10px; }
    .filter-action-group { display: grid; grid-template-columns: 1fr 1fr; }
    .filter-action-group .btn { width: 100%; }
}

/* 首页采用单一经营画布，以分隔线组织信息，不使用卡片拼接。 */
.dashboard-clean-shell {
    display: block !important;
    padding: 0 24px 24px;
    background: #fff;
    border: 1px solid #e5e8ef;
    border-radius: 12px;
    box-shadow: none;
}
.dashboard-clean-shell .dashboard-hero { gap: 0 !important; }
.dashboard-command-grid .dashboard-overview-header {
    padding: 22px 0 18px;
    border-bottom: 1px solid #e8ebf1;
}
.dashboard-command-grid .dashboard-overview-kpis {
    gap: 0;
    padding: 0;
    margin-bottom: 0 !important;
    background: #f8f9fb;
    border-top: 1px solid #e8ebf1;
    border-bottom: 1px solid #e8ebf1;
}
.dashboard-command-grid .dashboard-overview-kpi {
    position: relative;
    min-height: 136px;
    padding: 18px 22px 16px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.dashboard-command-grid .dashboard-overview-kpi::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 22px;
    width: 42px;
    height: 3px;
    background: #6f7f9d;
}
.dashboard-command-grid .dashboard-overview-kpi:nth-child(2)::before { background: #6f8f7d; }
.dashboard-command-grid .dashboard-overview-kpi:nth-child(3)::before { background: #8b8068; }
.dashboard-command-grid .dashboard-overview-kpi-value {
    margin-top: 6px;
    color: #20283a;
    font-size: 30px;
    letter-spacing: -0.035em;
}
.dashboard-command-grid .dashboard-overview-kpi-label {
    color: #70798e;
    font-size: 12px;
    font-weight: 650;
}
.dashboard-command-grid .dashboard-overview-kpi-detail {
    color: #7f889b;
}
.dashboard-command-grid .dashboard-overview-kpi-sparkline { opacity: .65; }
.dashboard-command-grid .dashboard-overview-kpi + .dashboard-overview-kpi {
    border-left: 1px solid #e8ebf1;
}
.dashboard-command-grid .dashboard-overview-kpi:hover {
    background: #fafbfc;
    border-color: #e8ebf1;
    transform: none;
}
.dashboard-command-grid .dashboard-overview-chart {
    margin: 0 !important;
    padding: 22px 24px 8px 0 !important;
    background: transparent;
    border: 0;
    border-radius: 0;
}
.dashboard-command-grid .dashboard-chart-graphic {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
}
.dashboard-chart-toggle-hint {
    color: #8790a3;
    font-size: 11px;
    white-space: nowrap;
}
.dashboard-command-grid .dashboard-todo-panel {
    height: 389px;
    max-height: 389px;
    background: transparent;
    border: 0;
    border-left: 1px solid #e8ebf1;
    border-radius: 0;
}
.dashboard-command-grid .dashboard-todo-panel > .card-body {
    padding: 22px 0 8px 24px !important;
}
.dashboard-command-grid .dashboard-todo-levels { gap: 0; }
.dashboard-command-grid .dashboard-todo-level {
    padding: 15px 0;
    background: transparent !important;
    border: 0 !important;
    border-top: 1px solid #eceef3 !important;
    border-radius: 0;
}
.dashboard-command-grid .dashboard-todo-level:first-child { border-top: 0 !important; }
.dashboard-command-grid .dashboard-todo-items,
.dashboard-command-grid .dashboard-todo-item { background: transparent !important; }
.dashboard-command-grid .dashboard-todo-item { padding-inline: 0; }
.dashboard-ranking-grid,
.dashboard-recent-grid {
    margin: 0 !important;
    padding-top: 20px;
    gap: 0 !important;
    border-top: 1px solid #e8ebf1;
}
.dashboard-ranking-grid .dashboard-block,
.dashboard-recent-grid .dashboard-block {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.dashboard-ranking-grid .dashboard-block + .dashboard-block,
.dashboard-recent-grid .dashboard-block + .dashboard-block {
    border-left: 1px solid #e8ebf1 !important;
}
.dashboard-ranking-grid .dashboard-block .card-header,
.dashboard-recent-grid .dashboard-block .card-header {
    padding: 0 20px 12px !important;
    background: transparent !important;
    border: 0 !important;
}
.dashboard-ranking-grid .dashboard-block:first-child .card-header,
.dashboard-ranking-grid .dashboard-block:first-child .card-body,
.dashboard-recent-grid .dashboard-block:first-child .card-header,
.dashboard-recent-grid .dashboard-block:first-child .card-body {
    padding-left: 0 !important;
}
.dashboard-ranking-grid .dashboard-block .card-body,
.dashboard-recent-grid .dashboard-block .card-body {
    padding: 0 20px 12px !important;
}

@media (max-width: 1180px) {
    .dashboard-clean-shell { padding-inline: 18px; }
    .dashboard-command-grid .dashboard-todo-panel {
        height: auto;
        border-left: 0;
        border-top: 1px solid #e8ebf1;
    }
    .dashboard-command-grid .dashboard-todo-panel > .card-body { padding-left: 0 !important; }
}
@media (max-width: 768px) {
    .dashboard-clean-shell { padding: 0 14px 14px; border-radius: 8px; }
    .dashboard-command-grid .dashboard-overview-kpis { display: block; }
    .dashboard-command-grid .dashboard-overview-kpi + .dashboard-overview-kpi {
        border-left: 0;
        border-top: 1px solid #e8ebf1;
    }
    .dashboard-command-grid .dashboard-overview-chart { padding-right: 0 !important; }
    .dashboard-ranking-grid,
    .dashboard-recent-grid { display: block !important; }
    .dashboard-ranking-grid .dashboard-block + .dashboard-block,
    .dashboard-recent-grid .dashboard-block + .dashboard-block {
        border-left: 0 !important;
        border-top: 1px solid #e8ebf1 !important;
        padding-top: 16px;
    }
}

/* 企业列表行操作：保留一个高频动作，其余动作收进统一菜单。 */
.enterprise-more-menu {
    display: inline-flex;
    vertical-align: middle;
}

.enterprise-more-menu > .btn {
    min-width: 36px;
    padding-inline: 10px;
}

.enterprise-more-menu .dropdown-menu {
    min-width: 156px;
    padding: 6px;
    border-color: var(--color-border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.enterprise-more-menu .dropdown-item {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.enterprise-more-menu form {
    margin: 0;
}

.enterprise-dropdown-portal {
    position: fixed !important;
    z-index: 1085 !important;
    margin: 0 !important;
}

.primary-record-link {
    color: var(--color-text);
    font-weight: 650;
    text-decoration: none;
}

.primary-record-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 企业级克制按钮色板：降低大面积高饱和色和发光阴影，保留明确的操作层级。 */
:root {
    --button-primary: #536b8e;
    --button-primary-hover: #465c7c;
    --button-success: #5d7869;
    --button-success-hover: #4f695b;
    --button-danger: #965b5f;
    --button-danger-hover: #824d51;
    --button-warning: #896f3f;
    --button-warning-hover: #755e35;
    --button-info: #5b7683;
    --button-info-hover: #4c6571;
}

.btn-primary,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    color: #fff;
    border-color: var(--button-primary);
    background: var(--button-primary);
    box-shadow: 0 2px 6px rgba(54, 70, 98, 0.12);
}
.btn-primary:hover {
    color: #fff;
    border-color: var(--button-primary-hover);
    background: var(--button-primary-hover);
    box-shadow: 0 3px 8px rgba(54, 70, 98, 0.16);
}

.btn-success,
.btn-success:focus,
.btn-success:active,
.btn-success.active {
    color: #fff;
    border-color: var(--button-success);
    background: var(--button-success);
    box-shadow: 0 2px 6px rgba(65, 91, 76, 0.1);
}
.btn-success:hover {
    color: #fff;
    border-color: var(--button-success-hover);
    background: var(--button-success-hover);
}

.btn-danger,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active {
    color: #fff;
    border-color: var(--button-danger);
    background: var(--button-danger);
    box-shadow: 0 2px 6px rgba(111, 61, 65, 0.1);
}
.btn-danger:hover {
    color: #fff;
    border-color: var(--button-danger-hover);
    background: var(--button-danger-hover);
}

.btn-warning,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active {
    color: #fff;
    border-color: var(--button-warning);
    background: var(--button-warning);
    box-shadow: 0 2px 6px rgba(92, 72, 34, 0.1);
}
.btn-warning:hover {
    color: #fff;
    border-color: var(--button-warning-hover);
    background: var(--button-warning-hover);
}

.btn-info,
.btn-info:focus,
.btn-info:active,
.btn-info.active {
    color: #fff;
    border-color: var(--button-info);
    background: var(--button-info);
    box-shadow: 0 2px 6px rgba(56, 79, 89, 0.1);
}
.btn-info:hover {
    color: #fff;
    border-color: var(--button-info-hover);
    background: var(--button-info-hover);
}

.btn-outline-primary { color: var(--button-primary); border-color: #9da9bb; }
.btn-outline-primary:hover { color: #fff; border-color: var(--button-primary); background: var(--button-primary); }
.btn-outline-success { color: #4f695b; border-color: #a7b7ad; }
.btn-outline-success:hover { color: #fff; border-color: var(--button-success); background: var(--button-success); }
.btn-outline-danger { color: #874f53; border-color: #c8a6a8; }
.btn-outline-danger:hover { color: #fff; border-color: var(--button-danger); background: var(--button-danger); }
.btn-outline-warning { color: #755e35; border-color: #c8b997; }
.btn-outline-warning:hover { color: #fff; border-color: var(--button-warning); background: var(--button-warning); }
.btn-outline-info { color: #4c6571; border-color: #a8b8bf; }
.btn-outline-info:hover { color: #fff; border-color: var(--button-info); background: var(--button-info); }

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(83, 107, 142, 0.2);
}

.btn:disabled,
.btn.disabled {
    box-shadow: none;
    opacity: 0.58;
}

/* 全站交互色收口：导航、表单、分页、反馈与辅助状态共用同一低饱和企业色板。 */
.form-control:focus,
.form-select:focus {
    border-color: #8c9bb0;
    box-shadow: 0 0 0 3px rgba(83, 107, 142, 0.14);
}

.app-sidebar .nav-link.active,
.sidebar-submenu-link.active {
    color: var(--button-primary);
    background: #edf1f6;
    box-shadow: inset 0 0 0 1px #dfe5ec;
}

.app-sidebar .nav-link.active::before {
    background: #7f8fa6;
}

.page-kicker {
    color: var(--button-primary);
    background: #edf1f6;
}

.form-check-input:checked {
    border-color: var(--button-primary);
    background-color: var(--button-primary);
}

.form-check-input:focus {
    border-color: #8c9bb0;
    box-shadow: 0 0 0 3px rgba(83, 107, 142, 0.14);
}

.pagination .page-item.active .page-link,
.page-item.active .page-link {
    color: #fff;
    border-color: var(--button-primary);
    background: var(--button-primary);
    box-shadow: 0 2px 6px rgba(54, 70, 98, 0.12);
}

.page-link {
    color: var(--button-primary);
}

.page-link:hover {
    color: var(--button-primary-hover);
    background: #f1f3f6;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link,
.dropdown-item.active,
.dropdown-item:active,
.list-group-item.active {
    color: #fff;
    border-color: var(--button-primary);
    background: var(--button-primary);
}

.progress-bar {
    background: var(--button-primary);
}

.text-primary { color: var(--button-primary) !important; }
.text-success { color: #4f695b !important; }
.text-warning { color: #755e35 !important; }
.text-danger { color: #874f53 !important; }
.text-info { color: #4c6571 !important; }

.empty-state i,
.user-avatar,
.sidebar-account-avatar,
.crm-confirm-icon {
    color: var(--button-primary);
    background: #edf1f6;
}

.activity-item::before {
    background: var(--button-primary);
    box-shadow: 0 0 0 4px rgba(83, 107, 142, 0.1);
}

.crm-toast {
    border-left-color: var(--button-primary);
}
.crm-toast-success { border-left-color: var(--button-success); }
.crm-toast-danger { border-left-color: var(--button-danger); }

.sidebar-collapse-btn:hover,
.sidebar-collapse-btn:focus-visible {
    color: var(--button-primary);
    background: #f1f3f6;
    border-color: #e2e6ec;
}

.system-config-nav a:hover {
    color: var(--button-primary);
    background: #f1f3f6;
}

.order-customer-link:hover {
    color: var(--button-primary);
    border-bottom-color: var(--button-primary);
}

.oauth-consent-icon,
.oauth-consent-account-icon {
    color: var(--button-primary);
    background: #edf1f6;
}

.oauth-consent-allow {
    border-color: var(--button-primary);
    background: var(--button-primary);
    box-shadow: 0 2px 6px rgba(54, 70, 98, 0.12);
}

/* AI 操作标识：紧贴按钮边缘的彩色光带持续流动。 */
@property --ai-orbit-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.ai-action-btn {
    --ai-orbit-angle: 0deg;
    position: relative;
    isolation: isolate;
    overflow: visible;
}

.ai-action-btn::before {
    content: "";
    position: absolute;
    z-index: -1;
    /* 内侧覆盖按钮边缘 1px，让流光与按钮轮廓自然重叠。 */
    inset: -1px;
    padding: 2px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--ai-orbit-angle),
        #a855f7 0deg,
        #ff4fd8 72deg,
        #4f8cff 150deg,
        #22d3ee 230deg,
        #7c5cff 305deg,
        #a855f7 360deg
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.94;
    filter: saturate(1.15);
    box-shadow:
        0 0 5px rgba(168, 85, 247, 0.34),
        0 0 8px rgba(34, 211, 238, 0.18);
    animation: ai-action-orbit 2.8s linear infinite;
}

.ai-action-btn:hover::before,
.ai-action-btn:focus-visible::before {
    opacity: 1;
    filter: saturate(1.3) brightness(1.08);
}

.ai-action-btn:disabled::before,
.ai-action-btn.disabled::before {
    opacity: 0.28;
    animation-play-state: paused;
}

@keyframes ai-action-orbit {
    to {
        --ai-orbit-angle: 360deg;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ai-action-btn::before {
        animation: none;
    }
}
