:root {
    --bg: #0A192F;
    --panel: #112240;
    --panel-soft: #172A45;
    --text: #CCD6F6;
    --muted: #8892B0;
    --line: #233554;
    --primary: #00BFFF;
    --primary-deep: #0EA5E9;
    --primary-soft: rgba(0, 191, 255, 0.1);
    --success: #64FFDA;
    --danger: #FF6B6B;
    --warning: #FFD93D;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #0A192F 0%, #0D2137 100%);
}

.admin-shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
}
.sidebar {
    background: linear-gradient(180deg, rgba(10, 25, 47, 0.98), rgba(17, 34, 64, 0.95));
    border-right: 1px solid rgba(35, 53, 84, 0.8);
    padding: 22px 12px;
    backdrop-filter: blur(14px);
    height: 100dvh;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}
.sidebar::-webkit-scrollbar {
    width: 8px;
}
.sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(0, 191, 255, 0.25);
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; padding: 10px 12px; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
    color: #fff; background: linear-gradient(135deg, #00BFFF, #7b61ff); font-weight: 700; box-shadow: 0 4px 16px rgba(0, 191, 255, 0.3);
}
.brand-text { display: flex; flex-direction: column; gap: 4px; }
.brand-text strong { font-size: 28px; line-height: 1; }
.brand-text span { font-size: 12px; color: var(--muted); }
.sidebar-search input {
    width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: rgba(10, 25, 47, 0.6); color: var(--text);
    margin-bottom: 18px;
}
.sidebar-search input::placeholder {
    color: var(--muted);
}
.sidebar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.15);
    outline: none;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 10px; }
.nav-group {
    border-radius: 14px;
    border: 1px solid transparent;
    background: transparent;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.nav-group:hover {
    border-color: rgba(0, 191, 255, 0.2);
    background: rgba(0, 191, 255, 0.05);
}
.nav-group-trigger {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--muted);
    text-align: left;
    padding: 10px 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.nav-group-trigger:hover {
    color: var(--primary);
    background: rgba(0, 191, 255, 0.08);
}
.nav-group-title {
    text-transform: uppercase;
}
.nav-group-arrow {
    display: inline-block;
    font-size: 12px;
    opacity: 0.9;
    transform: rotate(-90deg);
    transition: transform 0.2s ease;
}
.nav-group.is-open .nav-group-arrow {
    transform: rotate(0deg);
}
.nav-group-items {
    display: none;
    padding: 4px 8px 10px;
    grid-template-columns: 1fr;
    gap: 6px;
    overflow: hidden;
}
.nav-group.is-open .nav-group-items {
    display: grid;
    opacity: 1;
    transform: translateY(0);
    animation: navGroupExpand 0.2s ease;
}

@keyframes navGroupExpand {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.nav-btn {
    border: 0; background: transparent; color: var(--text); text-align: left; padding: 14px 16px; border-radius: 14px;
    font-size: 15px; cursor: pointer; transition: 0.2s ease; display: flex; align-items: center; gap: 10px; min-width: 0;
}
.nav-btn-sub {
    margin-left: 6px;
    padding-left: 14px;
    font-size: 14px;
    border-left: 2px solid rgba(0, 191, 255, 0.2);
}
.nav-icon { width: 18px; text-align: center; font-size: 14px; opacity: 0.9; flex: 0 0 auto; }
.nav-btn span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.nav-btn:hover, .nav-btn.active {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.2), rgba(14, 165, 233, 0.15)); color: var(--primary); box-shadow: 0 0 20px rgba(0, 191, 255, 0.15);
    border-color: rgba(0, 191, 255, 0.3);
}
.nav-group.drag-over {
    border-color: rgba(0, 191, 255, 0.45);
    background: rgba(0, 191, 255, 0.08);
}
.nav-btn.drag-over {
    outline: 2px dashed rgba(0, 191, 255, 0.46);
    outline-offset: 2px;
}
.nav-group.is-dragging,
.nav-btn.is-dragging {
    opacity: 0.62;
}
.nav-group-trigger.is-drag-armed,
.nav-btn.is-drag-armed {
    outline: 2px dashed rgba(0, 191, 255, 0.36);
    outline-offset: 2px;
}

.workspace {
    padding: 20px 24px 28px;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.topbar {
    background: rgba(17, 34, 64, 0.92); border: 1px solid rgba(35, 53, 84, 0.8); border-radius: 20px;
    padding: 20px 24px; box-shadow: var(--shadow); display: flex; justify-content: space-between; gap: 20px; align-items: center;
}
.topbar h1 { margin: 0 0 8px; font-size: 30px; }
.topbar p { margin: 0; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.datetime, .ghost-link { color: var(--muted); font-size: 14px; }
.ghost-link { text-decoration: none; padding: 10px 14px; border-radius: 12px; background: rgba(0, 191, 255, 0.1); color: var(--primary); transition: all 0.2s; }
.ghost-link:hover { background: rgba(0, 191, 255, 0.18); box-shadow: 0 0 12px rgba(0, 191, 255, 0.15); }
.dev-links {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 10px; font-size: 12px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--line);
}
.dev-links-label { color: var(--muted); font-size: 12px; }
.dev-links a {
    color: var(--primary); text-decoration: none; font-size: 12px;
    padding: 2px 6px; border-radius: 6px; transition: all 0.15s;
}
.dev-links a:hover { background: rgba(0, 191, 255, 0.12); }
.user-chip {
    display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
}
.avatar {
    width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
}
.user-chip span { display: block; font-size: 12px; color: var(--muted); }
.logout-btn {
    border: 1px solid rgba(255, 107, 107, 0.3); color: var(--danger); background: rgba(255, 107, 107, 0.08); padding: 10px 16px; border-radius: 12px; cursor: pointer;
    transition: all 0.2s;
}
.logout-btn:hover {
    background: rgba(255, 107, 107, 0.15); box-shadow: 0 0 12px rgba(255, 107, 107, 0.15);
}

.content { margin-top: 22px; }
.stats-grid, .split-grid, .feature-grid, .front-grid { display: grid; gap: 18px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split-grid { grid-template-columns: 1.6fr 1fr; }
.feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.front-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.management-shell { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
.roles-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; }
.side-panel { padding: 20px; }
.section-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.filter-list { display: flex; flex-direction: column; gap: 8px; }
.filter-chip {
    width: 100%; border: 1px solid transparent; background: transparent; color: var(--text); border-radius: 12px;
    padding: 12px 14px; text-align: left; cursor: pointer; transition: .2s ease;
}
.filter-chip:hover, .filter-chip.active { background: rgba(0, 191, 255, 0.1); color: var(--primary); border-color: rgba(0, 191, 255, 0.3); }
.filter-chip small { display: block; color: var(--muted); margin-top: 4px; }
.toolbar-row, .data-toolbar, .table-footer, .inline-actions { display: flex; align-items: center; gap: 12px; }
.toolbar-row, .data-toolbar, .table-footer { justify-content: space-between; flex-wrap: wrap; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bulk-check-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.searchable-select-wrap {
    position: relative;
    display: grid;
    gap: 6px;
}
.searchable-select-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.searchable-select-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 40px 10px 12px;
    background: rgba(10, 25, 47, 0.6);
    color: var(--text);
}
.searchable-select-wrap.is-open .searchable-select-input {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.15);
}
.searchable-select-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}
.searchable-select-clear-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 191, 255, 0.08);
}
.searchable-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #112240;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.4);
    z-index: 30;
}
.searchable-select-wrap.is-open .searchable-select-dropdown {
    display: block;
}
.searchable-select-option {
    width: 100%;
    border: 0;
    background: #112240;
    color: var(--text);
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
}
.searchable-select-option:hover,
.searchable-select-option.is-active {
    background: rgba(0, 191, 255, 0.1);
    color: var(--primary);
}
.searchable-select-empty {
    padding: 10px 12px;
    color: var(--muted);
    font-size: 13px;
}
.searchable-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.region-inline-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.toolbar-input, .toolbar-select {
    min-width: 180px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(10, 25, 47, 0.6); color: var(--text); font: inherit;
}
.toolbar-input:focus, .toolbar-select:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.15); outline: none;
}
.toolbar-stat { color: var(--muted); font-size: 13px; }
.role-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.role-badge {
    display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: rgba(0, 191, 255, 0.1); color: var(--primary); font-size: 12px; font-weight: 600;
}
.status-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.status-pill.enabled { background: rgba(100, 255, 218, 0.12); color: #64FFDA; }
.status-pill.disabled { background: rgba(255, 217, 61, 0.12); color: #FFD93D; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.link-btn { border: 0; background: transparent; color: var(--primary-deep); cursor: pointer; padding: 0; font: inherit; }
.link-btn:disabled { cursor: not-allowed; opacity: 0.65; }
.link-btn-loading { color: var(--muted); }
.danger-link { color: var(--danger); }
.table-wrap { overflow: auto; }
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pager-btn {
    min-width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer;
    transition: all 0.2s;
}
.pager-btn:hover { border-color: var(--primary); box-shadow: 0 0 8px rgba(0, 191, 255, 0.15); }
.pager-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 0 12px rgba(0, 191, 255, 0.3); }
.pager-btn:disabled { cursor: not-allowed; opacity: 0.5; }
.pager-wrap { margin-top: 14px; }
.pager-size { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.pager-size select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--panel); color: var(--text); }
.pager-ellipsis { color: var(--muted); padding: 0 2px; }
.helper-text { color: var(--muted); font-size: 13px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.check-item span { flex: 1; min-width: 0; word-break: break-word; }
.check-item input[type="checkbox"] { flex: 0 0 auto; }
.switch-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.switch-inline input[type="checkbox"] { width: 16px; height: 16px; }
.role-list { display: flex; flex-direction: column; gap: 10px; }
.role-list-item {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel);
    cursor: pointer;
    transition: .2s ease;
    text-align: left;
}
.role-list-item:hover, .role-list-item.active {
    border-color: rgba(0, 191, 255, 0.4);
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.08), rgba(14, 165, 233, 0.05));
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.1);
}
.role-list-item strong {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
}
.role-list-item small {
    display: block;
    color: var(--muted);
    line-height: 1.5;
}
.role-list-item .inline-actions { margin-top: 10px; }
.permission-matrix { display: flex; flex-direction: column; gap: 18px; }
.permission-group {
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: var(--panel);
}
.permission-group-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 16px 18px;
    background: var(--panel-soft);
    border-bottom: 1px solid var(--line);
}
.permission-group-head h4 { margin: 0; font-size: 16px; }
.permission-group-head span { color: var(--muted); font-size: 13px; }
.permission-grid-table { width: 100%; border-collapse: collapse; }
.permission-grid-table th, .permission-grid-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.permission-grid-table th { background: var(--panel-soft); color: var(--muted); font-size: 13px; }
.permission-grid-table tr:last-child td { border-bottom: 0; }
.matrix-checks { display: flex; gap: 12px; flex-wrap: wrap; }
.matrix-checks label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text);
}
.toolbar-more {
    position: relative;
    width: 100%;
}
.toolbar-more-trigger {
    list-style: none;
    width: 100%;
    text-align: left;
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--text);
}
.toolbar-more-trigger::-webkit-details-marker { display: none; }
.toolbar-more-menu {
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #112240;
    padding: 10px;
    box-shadow: var(--shadow);
}
.toolbar-more-menu-full {
    width: 100%;
    max-height: 260px;
    overflow: auto;
}
.ship-user-picker-menu {
    background: var(--panel-soft);
}
.ship-user-picker-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.ship-user-list {
    display: grid;
    gap: 8px;
}
.ship-user-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    margin-bottom: 8px;
}
.ship-user-option span {
    color: var(--text);
    font-size: 13px;
    flex: 1;
}
.ship-user-option input[type="checkbox"] {
    flex: 0 0 auto;
}
.logo-upload-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---- site logo upload card ---- */
.site-logo-card {
    position: relative;
    width: 200px;
    height: 140px;
    border: 2px dashed var(--line);
    border-radius: 14px;
    background: var(--panel-soft);
    cursor: pointer;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.site-logo-card:hover { border-color: var(--primary); box-shadow: 0 0 16px rgba(0, 191, 255, 0.15); }
.site-logo-card.drag-over { border-color: var(--primary); background: rgba(0, 191, 255, 0.08); }
.site-logo-card.has-image { border-style: solid; border-color: transparent; background: transparent; }
.site-logo-card .upload-hint-icon { font-size: 28px; color: var(--muted); }
.site-logo-card .upload-hint-text { font-size: 13px; color: var(--muted); }
.site-logo-card .upload-hint-sub { font-size: 11px; color: var(--muted); }
.site-logo-card img {
    width: 100%; height: 100%; object-fit: contain;
}
.site-logo-remove {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(0,0,0,.5); color: #fff; border: none;
    font-size: 14px; line-height: 22px; text-align: center;
    cursor: pointer; opacity: 0; transition: opacity .15s;
    z-index: 2; padding: 0;
}
.site-logo-card:hover .site-logo-remove { opacity: 1; }
.site-logo-remove:hover { background: rgba(239,68,68,.85); }
.order-media-upload-bar {
    margin-top: 4px;
}
.order-media-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.order-media-pick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 118px;
    user-select: none;
}
.order-media-list {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.order-media-empty {
    color: var(--muted);
    font-size: 13px;
    padding: 6px 0;
}
.order-media-card {
    position: relative;
    width: 168px;
}
.order-media-thumb-wrap {
    position: relative;
    width: 168px;
    height: 112px;
}
.order-media-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--panel-soft);
}
.order-media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.order-media-thumb-file span {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}
.order-media-remove-btn {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.86);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.logo-preview { display: none; }

/* ── unified image-upload grid ── */
.img-upload-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}
.img-upload-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 14px;
    border: 1px solid var(--line);
    overflow: hidden;
    background: var(--panel-soft);
}
.img-upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}
.img-upload-item:hover img {
    opacity: .85;
}
.img-upload-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(15,23,42,.72);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    opacity: 0;
    transition: opacity .15s;
    padding: 0;
}
.img-upload-item:hover .img-upload-del {
    opacity: 1;
}
.img-upload-del:hover {
    background: rgba(239,68,68,.88);
}
.img-upload-item-file {
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.img-upload-add {
    width: 120px;
    height: 120px;
    border-radius: 14px;
    border: 2px dashed var(--line);
    background: var(--panel-soft);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--muted);
    font-size: 32px;
    transition: border-color .15s, background .15s;
    user-select: none;
    flex-shrink: 0;
}
.img-upload-add:hover {
    border-color: var(--primary);
    background: rgba(0, 191, 255, 0.08);
    color: var(--primary);
}
.img-upload-add input[type="file"] {
    display: none;
}

.card, .metric-card, .hero-card {
    background: rgba(17, 34, 64, 0.94); border: 1px solid rgba(35, 53, 84, 0.8); border-radius: 20px; box-shadow: var(--shadow);
}
.hero-card {
    padding: 24px 26px;
    background: radial-gradient(circle at right top, rgba(0, 191, 255, 0.15), transparent 28%), linear-gradient(135deg, #112240 0%, #0D2137 100%);
}
.hero-card h2, .card h3 { margin: 0 0 8px; }
.hero-card p, .card-subtitle { margin: 0; color: var(--muted); }
.hero-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.primary-btn, .secondary-btn, .mini-btn { border: 0; border-radius: 12px; cursor: pointer; transition: all 0.25s ease; }
.primary-btn { background: linear-gradient(135deg, #00BFFF, #0EA5E9); color: #fff; padding: 12px 18px; }
.primary-btn:hover { box-shadow: 0 0 24px rgba(0, 191, 255, 0.35); transform: translateY(-1px); }
.secondary-btn { background: rgba(0, 191, 255, 0.1); color: var(--primary); padding: 12px 18px; }
.secondary-btn:hover { background: rgba(0, 191, 255, 0.18); box-shadow: 0 0 16px rgba(0, 191, 255, 0.15); }
.mini-btn { background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 8px 12px; }
.mini-btn:hover { border-color: var(--primary); box-shadow: 0 0 12px rgba(0, 191, 255, 0.1); }
.metric-card { padding: 20px; }
.metric-card .label { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.metric-card .value { font-size: 30px; font-weight: 700; }
.metric-card .hint { margin-top: 8px; color: var(--muted); font-size: 13px; }
.card { padding: 22px; }
.status-list, .shortcut-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.status-item, .shortcut-item {
    display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px;
    background: var(--panel-soft); border: 1px solid var(--line);
}
.tag { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag.success { background: rgba(100, 255, 218, 0.12); color: #64FFDA; }
.tag.info { background: rgba(0, 191, 255, 0.12); color: #00BFFF; }
.tag.warn { background: rgba(255, 217, 61, 0.12); color: #FFD93D; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.simple-table { width: 100%; border-collapse: collapse; overflow: hidden; }
.simple-table th, .simple-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.simple-table th { font-size: 13px; color: var(--muted); font-weight: 600; }
.shipment-province-cell {
    max-width: 140px;
    width: 140px;
}
.shipment-ellipsis {
    display: inline-block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: top;
}
.shipment-detail-editor-table td { padding: 8px 10px; }
.shipment-detail-editor-table input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: rgba(10, 25, 47, 0.6);
    color: var(--text);
    font: inherit;
}
.empty { padding: 30px 10px; text-align: center; color: var(--muted); }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* ── Settings page sections ── */
.settings-form { display: flex; flex-direction: column; gap: 0; }
.settings-section {
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
}
.settings-section:first-of-type { padding-top: 12px; }
.settings-section:last-of-type { border-bottom: none; }
.settings-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.settings-section-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 20px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    flex-shrink: 0;
}
.settings-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.settings-section-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

/* ── Security cards grid ── */
.settings-security-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.settings-security-card {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.settings-security-card:hover {
    border-color: rgba(0, 191, 255, 0.25);
}
.settings-security-card.is-active {
    border-color: rgba(100, 255, 218, 0.35);
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.06);
}
.settings-security-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.settings-security-icon { font-size: 22px; }
.settings-security-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.settings-security-card-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}
.settings-security-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    width: fit-content;
}
.settings-security-badge.badge-on {
    background: rgba(100, 255, 218, 0.12);
    color: var(--success);
}
.settings-security-badge.badge-off {
    background: rgba(136, 146, 176, 0.12);
    color: var(--muted);
}

/* ── Toggle switch ── */
.settings-toggle,
.settings-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}
.settings-toggle input[type="checkbox"],
.settings-toggle-label input[type="checkbox"] {
    display: none;
}
.settings-toggle-switch {
    width: 40px;
    height: 22px;
    border-radius: 12px;
    background: var(--line);
    position: relative;
    transition: background 0.25s;
    flex-shrink: 0;
}
.settings-toggle-switch::after {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--muted);
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.25s, background 0.25s;
}
.settings-toggle input:checked + .settings-toggle-switch,
.settings-toggle-label input:checked + .settings-toggle-switch {
    background: rgba(100, 255, 218, 0.25);
}
.settings-toggle input:checked + .settings-toggle-switch::after,
.settings-toggle-label input:checked + .settings-toggle-switch::after {
    transform: translateX(18px);
    background: var(--success);
}

/* ── Settings footer ── */
.settings-footer {
    padding: 24px 0 4px;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 1024px) {
    .settings-security-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .settings-security-grid { grid-template-columns: 1fr; }
}
.file-picker-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.file-picker-inline .helper-text {
    max-width: 100%;
    word-break: break-all;
}
.asset-file-inline-actions {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.asset-upload-inline-layout {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.asset-upload-controls {
    flex: 1 1 280px;
    min-width: 260px;
}
.asset-upload-preview-card {
    flex: 0 0 360px;
    width: 360px;
    height: 240px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--panel-soft) 0%, var(--panel) 100%);
    overflow: hidden;
    display: grid;
    place-items: center;
    position: relative;
}
.asset-upload-preview-card img,
.asset-upload-preview-card model-viewer {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    --poster-color: transparent;
    background: transparent;
}
.asset-upload-preview-placeholder {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
    padding: 16px;
}
@media (max-width: 980px) {
    .asset-upload-preview-card {
        width: 100%;
        max-width: 360px;
        height: 220px;
    }
}
.field input, .field textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: rgba(10, 25, 47, 0.6); color: var(--text); font: inherit;
}
.field input:focus, .field textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.15); outline: none;
}
.field input[type="file"] {
    font-size: 0;
    color: transparent;
    padding: 0;
    border: 0;
    background: transparent;
    width: auto;
    min-height: 42px;
}
.field input[type="file"]::file-selector-button {
    border: 1px solid rgba(0, 191, 255, 0.3);
    border-radius: 16px;
    padding: 10px 18px;
    background: rgba(0, 191, 255, 0.1);
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.field input[type="file"]::-webkit-file-upload-button {
    border: 1px solid rgba(0, 191, 255, 0.3);
    border-radius: 16px;
    padding: 10px 18px;
    background: rgba(0, 191, 255, 0.1);
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.field .multi-select {
    width: 100%;
    min-height: 144px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
    font: inherit;
    background: rgba(10, 25, 47, 0.6);
    color: var(--text);
}
.field input[type="checkbox"] {
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.checkbox-inline {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: var(--text) !important;
    font-weight: 600;
}
.contract-highlight {
    color: #b45309 !important;
}
.section-head {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(0, 191, 255, 0.1);
    color: var(--primary) !important;
    font-weight: 700;
}
.field select {
    width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: rgba(10, 25, 47, 0.6); color: var(--text); font: inherit;
}
.field select:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.15); outline: none;
}
.field textarea { min-height: 120px; resize: vertical; }
.field.full { grid-column: 1 / -1; }

.asset-custom-param-editor {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
    padding: 12px;
    display: grid;
    gap: 10px;
}

.asset-custom-param-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.asset-custom-param-rows {
    display: grid;
    gap: 8px;
}

.asset-custom-param-row {
    display: grid;
    grid-template-columns: minmax(140px, 1.2fr) 120px minmax(160px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.asset-custom-param-empty {
    color: var(--muted);
    font-size: 13px;
    padding: 10px 12px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: var(--panel);
}

.asset-custom-param-advanced summary {
    cursor: pointer;
    color: var(--primary-deep);
    font-weight: 600;
}

.asset-custom-param-advanced textarea {
    margin-top: 8px;
    min-height: 96px;
}

@media (max-width: 980px) {
    .asset-custom-param-row {
        grid-template-columns: 1fr;
    }
}

.json-block {
    margin: 0;
    max-width: 360px;
    max-height: 140px;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.draft-summary {
    min-width: 360px;
    max-width: 520px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
}

.draft-summary.compact {
    min-width: 300px;
    max-width: 480px;
    padding: 8px 10px;
}
.venue-meta-summary .draft-summary-value.contract-yes {
    color: #b45309;
    font-weight: 700;
}
.venue-meta-summary .draft-summary-value.contract-no {
    color: var(--muted);
}

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

.draft-summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.draft-summary-label {
    color: var(--muted);
    font-size: 12px;
}

.draft-summary-value {
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
}

.draft-summary-groups {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
    color: var(--text);
    font-size: 12px;
    line-height: 1.6;
}

.model-param-list {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
    padding: 10px 12px;
    max-height: 220px;
    overflow: auto;
}

.model-param-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
}

.model-param-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px dashed var(--line);
    padding-bottom: 4px;
    font-size: 12px;
}

.model-param-list li span {
    color: var(--muted);
    min-width: 88px;
}

.model-param-list li strong {
    color: var(--text);
    text-align: right;
    font-weight: 600;
    word-break: break-all;
}

.model-param-list details {
    margin-top: 8px;
}

.model-param-list details summary {
    cursor: pointer;
    color: var(--primary-deep);
    font-size: 12px;
    font-weight: 600;
}

.asset-preview-wrap {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 12px;
}

.asset-preview-meta {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: var(--text);
    line-height: 1.7;
}

.asset-preview-viewer {
    position: relative;
    height: 560px;
    border-radius: 14px;
    border: 1px solid var(--line);
    overflow: hidden;
    background: rgba(10, 25, 47, 0.5);
}
.asset-seat-thumb {
    width: 140px;
    display: grid;
    gap: 6px;
}
.asset-seat-thumb model-viewer {
    width: 140px;
    height: 90px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(10, 25, 47, 0.5);
}
.asset-seat-thumb a {
    font-size: 12px;
}
.asset-seat-thumb-fallback {
    display: grid;
    gap: 4px;
}
.snapshot-thumb-wrap {
    width: 132px;
    height: 78px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--panel-soft);
}
.snapshot-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.snapshot-preview-wrap {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: auto;
    max-height: 72vh;
    background: var(--panel-soft);
}
.snapshot-preview-wrap-full {
    max-height: 74vh;
    padding: 10px;
    display: block;
}
.snapshot-preview-image {
    width: 100%;
    height: auto;
    display: block;
}
.snapshot-preview-image-full {
    width: 100%;
    max-width: 100%;
    max-height: none;
    min-width: 0;
    object-fit: contain;
}
.snapshot-preview-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.snapshot-detail-list-wrap {
    max-height: 38vh;
}
.snapshot-preview-wrap-detail {
    height: 70vh;
    max-height: 70vh;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 25, 47, 0.5);
}
.snapshot-preview-image-detail {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(70vh - 24px);
    object-fit: contain;
    margin: 0 auto;
}
.contract-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.contract-photo-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-soft);
    overflow: hidden;
    position: relative;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.contract-photo-item img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}
.contract-photo-remove-btn {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    line-height: 1;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 2;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.35);
}
.contract-photo-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 10px;
}
.asset-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 25, 47, 0.88);
    z-index: 2;
}
.asset-preview-loading.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
}
.loading-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--line);
    border-top-color: var(--primary);
    animation: loadingSpin 0.8s linear infinite;
}
@keyframes loadingSpin {
    to { transform: rotate(360deg); }
}

.login-page {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: #0A192F;
}

.dashboard-filters .toolbar-row {
    align-items: flex-end;
}

.dashboard-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-range .toolbar-input,
.dashboard-range .toolbar-select {
    min-width: 130px;
}

.dashboard-range .toolbar-input.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.dashboard-charts .card {
    min-height: 280px;
}

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

.mini-line-chart polyline {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mini-line-chart .line-area {
    fill: currentColor;
    opacity: 0.12;
}

.mini-line-chart .axis-line {
    stroke: var(--line);
    stroke-width: 1;
}

.mini-line-chart .axis-grid {
    stroke: var(--line);
    stroke-width: 1;
}

.mini-line-chart .axis-text {
    fill: var(--muted);
    font-size: 10px;
}

.mini-line-chart .axis-y {
    text-anchor: end;
}

.mini-line-chart .axis-x {
    text-anchor: middle;
}

.mini-line-chart .axis-name {
    fill: var(--text);
    font-size: 11px;
    font-weight: 600;
}

.mini-line-chart .axis-name-x {
    text-anchor: end;
}

.mini-line-chart .line-point {
    fill: var(--panel);
    stroke: currentColor;
    stroke-width: 1.6;
}

.mini-line-chart .point-text {
    fill: var(--text);
    font-size: 10px;
    text-anchor: middle;
    font-weight: 600;
}

.mini-line-chart .bar-rect {
    fill: currentColor;
    opacity: 0.82;
}

.mini-line-chart .bar-rect:hover {
    opacity: 0.95;
}

.line-blue polyline { stroke: #3b82f6; }
.line-purple polyline { stroke: #8b5cf6; }
.line-green polyline { stroke: #10b981; }
.line-blue { color: #3b82f6; }
.line-purple { color: #8b5cf6; }
.line-green { color: #10b981; }

.mini-empty {
    min-height: 190px;
    display: grid;
    place-items: center;
}

.mini-bars {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.mini-bar-row {
    display: grid;
    grid-template-columns: 110px 1fr 46px;
    align-items: center;
    gap: 10px;
}

.mini-bar-row span {
    color: var(--text);
    font-size: 13px;
}

.mini-bar-row strong {
    color: var(--primary-deep);
    text-align: right;
}

.mini-bar-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(0, 191, 255, 0.08);
    overflow: hidden;
}

.mini-bar-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #00BFFF, #7b61ff);
}

.mini-pie-wrap {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    align-items: center;
}

.mini-pie {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto;
}

.mini-pie-hole {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: var(--panel);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    color: var(--primary);
    font-size: 22px;
    font-weight: 700;
}

.mini-pie-legend {
    display: grid;
    gap: 8px;
}

.mini-pie-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-soft);
}

.mini-pie-item span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
}

.mini-pie-item i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

@media (max-width: 900px) {
    .mini-pie-wrap {
        grid-template-columns: 1fr;
    }
}

.login-background {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.bg-slide {
    position: absolute;
    inset: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 1.2s ease, transform 8s ease;
}

.bg-slide.is-active {
    opacity: 1;
    transform: scale(1.08);
}

.bg-slide-a {
    background-image: url('/frontend/assets/login-bg-1.jpg');
}

.bg-slide-b {
    background-image: url('/frontend/assets/login-bg-2.jpg');
}

.bg-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(6, 12, 24, 0.08) 0%, rgba(6, 12, 24, 0.02) 48%, rgba(6, 12, 24, 0.10) 100%);
}

.gradient-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 20%, rgba(59, 130, 246, 0.14), transparent 32%),
        radial-gradient(circle at 85% 24%, rgba(14, 165, 233, 0.10), transparent 30%);
}

.pattern-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(31, 120, 209, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 120, 209, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.35));
}

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(360px, 480px);
    gap: 32px;
    align-items: center;
    padding: 40px clamp(20px, 4vw, 48px);
    width: min(1220px, 100%);
    margin: 0 auto;
}

.login-info {
    padding: clamp(18px, 2.6vw, 28px);
    color: #f8fbff;
    background: rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    backdrop-filter: blur(6px);
    box-shadow: 0 22px 46px rgba(2, 6, 23, 0.12);
}

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #dbeafe;
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.system-title {
    margin: 18px 0 12px;
    font-size: clamp(38px, 4.2vw, 56px);
    line-height: 1.08;
}

.system-subtitle {
    margin: 0;
    font-size: 18px;
    color: rgba(241, 245, 249, 0.86);
}

.feature-list {
    display: grid;
    gap: 14px;
    margin-top: 32px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.2);
    font-size: 16px;
    font-weight: 600;
}

.feature-item svg {
    color: #93c5fd;
    flex: 0 0 auto;
}

.login-form-wrapper {
    display: flex;
    justify-content: center;
}

.login-form-card {
    width: 100%;
    padding: 34px 32px 30px;
    border-radius: 28px;
    background: rgba(17, 34, 64, 0.35);
    border: 1px solid rgba(35, 53, 84, 0.4);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
}

.login-header {
    margin-bottom: 24px;
}

.login-header h2 {
    margin: 0 0 8px;
    font-size: 32px;
    color: #fff;
}

.login-header p {
    margin: 0;
    color: var(--muted);
}

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

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

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #E2E8F0;
}

.input-wrapper,
.captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-wrapper {
    min-height: 58px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(10, 25, 47, 0.6);
}

.input-wrapper:focus-within,
.captcha-wrapper input:focus,
.captcha-display:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 191, 255, 0.15);
}

.input-icon {
    color: #98a7bf;
    flex: 0 0 auto;
}

.input-wrapper input,
.captcha-wrapper input {
    width: 100%;
    border: 0;
    outline: none;
    font: inherit;
    color: var(--text);
    background: transparent;
}

.toggle-password,
.refresh-captcha {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: rgba(0, 191, 255, 0.08);
    color: var(--text);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.toggle-password:hover,
.refresh-captcha:hover {
    background: rgba(0, 191, 255, 0.15);
    transform: translateY(-1px);
}

.captcha-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 136px 44px;
    align-items: stretch;
}

.captcha-wrapper input {
    min-height: 58px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(10, 25, 47, 0.6);
    color: var(--text);
}

.captcha-display {
    min-height: 58px;
    padding: 8px 10px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    outline: none;
}

.captcha-display span {
    min-width: 24px;
    padding: 5px 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #00BFFF, #00b4db);
    color: #fff;
    text-align: center;
    font-weight: 700;
    line-height: 1.1;
    box-shadow: 0 6px 14px rgba(0, 191, 255, 0.2);
    flex: 0 0 auto;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.forgot-password,
.frontend-login-link a {
    color: var(--primary-deep);
    text-decoration: none;
    font-weight: 600;
}

.login-btn {
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #00BFFF, #0EA5E9);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 18px 30px rgba(0, 191, 255, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 34px rgba(0, 191, 255, 0.35);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.login-footer {
    display: grid;
    gap: 8px;
    text-align: center;
}

.admin-login-hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.frontend-login-link {
    margin: 0;
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
}

.toast-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.toast.success {
    background: rgba(22, 128, 61, 0.94);
    color: #fff;
}

.toast.error {
    background: rgba(194, 65, 12, 0.94);
    color: #fff;
}

.toast.warning {
    background: rgba(161, 98, 7, 0.94);
    color: #fff;
}

@media (max-width: 1080px) {
    .login-shell {
        grid-template-columns: 1fr;
        padding-top: 32px;
        padding-bottom: 32px;
    }

    .login-info {
        padding-bottom: 0;
    }

    .system-title {
        font-size: 34px;
    }
}

@media (max-width: 640px) {
    .login-shell {
        padding: 0;
        gap: 0;
        border-radius: 0;
        max-width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .login-info {
        padding: 22px 18px 18px;
        border-radius: 0;
    }

    .system-title {
        font-size: 24px;
    }

    .login-form-card {
        padding: 22px 18px 20px;
        border-radius: 18px;
    }

    .login-header h2 {
        font-size: 22px;
    }

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

    .refresh-captcha {
        width: 100%;
    }

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

    .login-footer p {
        font-size: 13px;
    }
}
.permission-grid .check-item small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}
.simple-table a {
    color: var(--primary-deep);
    text-decoration: none;
}
.json-readable {
    display: grid;
    gap: 4px;
    font-size: 12px;
    line-height: 1.45;
    max-width: 360px;
}
.json-readable strong {
    color: var(--text);
    font-weight: 700;
}
.simple-table code {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(0, 191, 255, 0.1);
    color: var(--primary);
}
.modal-mask {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: none; align-items: center; justify-content: center;
    padding: 20px; z-index: 1000;
}
.modal-mask.show { display: flex; }
.modal-card {
    width: min(720px, 100%); max-height: calc(100vh - 40px); background: #112240; border-radius: 20px;
    border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    display: flex; flex-direction: column; overflow: hidden;
}
.modal-header, .modal-footer { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-header { position: sticky; top: 0; background: #112240; z-index: 3; }
.modal-footer {
    border-bottom: 0; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px;
    position: sticky; bottom: 0; background: #112240; z-index: 3;
}
.modal-body { padding: 20px; overflow: auto; min-height: 0; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.modal-header h3 { margin: 0; }
.modal-close { border: 0; background: transparent; font-size: 28px; cursor: pointer; color: var(--muted); }
.history-timeline {
    display: grid;
    gap: 12px;
}
.history-entry {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    padding: 12px 14px;
    display: grid;
    gap: 8px;
}
.history-entry.history-submit-variant-0 { border-left: 4px solid #2563eb; background: rgba(37, 99, 235, 0.08); }
.history-entry.history-submit-variant-1 { border-left: 4px solid #0ea5e9; background: rgba(14, 165, 233, 0.08); }
.history-entry.history-submit-variant-2 { border-left: 4px solid #10b981; background: rgba(16, 185, 129, 0.08); }
.history-entry.history-submit-variant-3 { border-left: 4px solid #f59e0b; background: rgba(245, 158, 11, 0.08); }
.history-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.history-type-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}
.history-type-tag.is-submit { background: rgba(37, 99, 235, 0.15); color: #60A5FA; }
.history-type-tag.is-update { background: rgba(194, 65, 12, 0.15); color: #FB923C; }
.history-type-tag.is-image { background: rgba(109, 40, 217, 0.15); color: #A78BFA; }
.history-type-tag.is-complete { background: rgba(16, 185, 129, 0.15); color: #64FFDA; }
.history-type-tag.is-admin { background: rgba(100, 116, 139, 0.15); color: #94A3B8; }
.history-type-tag.is-default { background: rgba(71, 85, 105, 0.15); color: #94A3B8; }
.history-time {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
.history-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text);
    font-size: 13px;
}
.history-note {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px dashed var(--line);
    background: var(--panel-soft);
    color: var(--text);
    font-size: 13px;
}
.history-detail-list {
    display: grid;
    gap: 6px;
}
.history-detail-row {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 10px;
    align-items: start;
    font-size: 13px;
}
.history-detail-label {
    color: var(--muted);
    font-weight: 600;
}
.history-detail-value {
    color: var(--text);
    word-break: break-word;
}
.history-name-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}
.history-name-list li {
    color: var(--text);
}
.history-name-sub {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}
.history-json-block {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: var(--text);
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
}
.history-table-wrap {
    overflow-x: auto;
}
.history-submit-table {
    width: 100%;
    min-width: 640px;
}
.global-loading-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.24);
    z-index: 1300;
}
.global-loading-overlay.show { display: flex; }
.global-loading-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(17, 34, 64, 0.95);
    color: var(--text);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
    font-weight: 600;
}
.toast {
    position: fixed; right: 24px; bottom: 24px; min-width: 220px; max-width: 360px; padding: 14px 16px; border-radius: 14px;
    color: #fff; background: rgba(22, 32, 51, 0.92); box-shadow: var(--shadow); opacity: 0; transform: translateY(10px);
    pointer-events: none; transition: 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

.snapshot-batch-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    margin-bottom: 16px;
    background: var(--panel);
    overflow: hidden;
}
.snapshot-batch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}
.snapshot-batch-head h4 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
}
.snapshot-batch-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}
.snapshot-batch-card.batch-a { border-left: 4px solid #2563eb; }
.snapshot-batch-card.batch-b { border-left: 4px solid #0ea5e9; }
.snapshot-batch-card.batch-c { border-left: 4px solid #10b981; }
.snapshot-batch-card.batch-d { border-left: 4px solid #f59e0b; }
.snapshot-batch-card.batch-e { border-left: 4px solid #ef4444; }
.snapshot-batch-card.batch-f { border-left: 4px solid #8b5cf6; }
.snapshot-batch-tag.batch-a { background: rgba(37, 99, 235, 0.15); color: #60A5FA; }
.snapshot-batch-tag.batch-b { background: rgba(14, 165, 233, 0.15); color: #22D3EE; }
.snapshot-batch-tag.batch-c { background: rgba(16, 185, 129, 0.15); color: #64FFDA; }
.snapshot-batch-tag.batch-d { background: rgba(245, 158, 11, 0.15); color: #FFD93D; }
.snapshot-batch-tag.batch-e { background: rgba(239, 68, 68, 0.15); color: #FF6B6B; }
.snapshot-batch-tag.batch-f { background: rgba(139, 92, 246, 0.15); color: #A78BFA; }

.cutting-param-quick-list {
    display: grid;
    gap: 8px;
    max-height: 300px;
    overflow: auto;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
}
.template-search-input {
    width: 100%;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text);
    background: var(--panel);
}
.template-search-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.15);
}
.cutting-param-item-btn {
    width: 100%;
    text-align: left;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 10px;
    padding: 9px 12px;
    cursor: pointer;
}
.cutting-param-item-btn:hover {
    border-color: var(--primary);
    background: rgba(0, 191, 255, 0.08);
}
.cutting-param-item-btn.is-selected {
    border-color: var(--primary);
    background: rgba(0, 191, 255, 0.12);
    color: var(--primary);
}
#selectedCuttingParamsEditor,
#selectedShipmentTemplatesEditor {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
    padding: 10px;
    overflow-x: auto;
}
.cutting-selected-list {
    display: grid;
    gap: 8px;
}
.cutting-selected-header,
.cutting-selected-row {
    display: grid;
    grid-template-columns: 64px minmax(160px, 1.2fr) minmax(160px, 1.1fr) minmax(130px, 1fr) 110px 130px 72px;
    gap: 8px;
    align-items: center;
    min-width: 900px;
}
.cutting-selected-header {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(0, 191, 255, 0.1);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}
.cutting-selected-row {
    margin-bottom: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
}
.cutting-selected-row > * {
    min-width: 0;
}
.cutting-selected-row input,
.cutting-selected-row select {
    width: 100%;
    box-sizing: border-box;
}
.cutting-selected-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}
.cutting-selected-check input {
    margin: 0;
}
.cutting-selected-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.cutting-selected-row [data-selected-remove] {
    justify-self: center;
}

.china-map-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1.45fr) minmax(320px, 1fr);
    gap: 14px;
    align-items: start;
}
.china-map-canvas {
    min-height: 520px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
}
.china-map-side {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    padding: 12px;
}
.china-map-city-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}
.china-map-rank-list {
    display: grid;
    gap: 8px;
    margin: 10px 0;
    max-height: 220px;
    overflow: auto;
}
.china-map-rank-item {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-soft);
    padding: 9px 10px;
    display: grid;
    grid-template-columns: 26px 1fr auto;
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
}
.china-map-rank-item:hover,
.china-map-rank-item.active {
    border-color: var(--primary);
    background: rgba(0, 191, 255, 0.08);
}
.china-map-rank-no {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 12px;
    color: var(--primary);
    background: rgba(0, 191, 255, 0.15);
}
.china-map-rank-name {
    font-weight: 600;
}
.china-map-rank-count {
    color: var(--primary);
}
.china-map-shipment-list .table-wrap {
    max-height: 390px;
}

@media (max-width: 1200px) {
    .stats-grid, .front-grid, .feature-grid, .split-grid, .kv-grid, .management-shell, .roles-layout { grid-template-columns: 1fr 1fr; }
    .china-map-layout { grid-template-columns: 1fr; }
    .china-map-canvas { min-height: 420px; }
}

@media (min-width: 901px) and (max-width: 1366px) {
    .admin-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .sidebar {
        padding: 16px 10px;
    }

    .brand {
        padding: 8px 10px;
        margin-bottom: 14px;
    }

    .brand-text strong {
        font-size: 24px;
    }

    .topbar {
        padding: 16px 18px;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .topbar h1 {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .topbar-right {
        width: 100%;
        justify-content: flex-start;
    }

    .content {
        margin-top: 14px;
    }

    .table-wrap,
    .history-table-wrap {
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .modal-card {
        width: min(96vw, 980px);
        max-height: min(92dvh, 920px);
    }
}

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; height: auto; overflow: visible; }
    .sidebar { position: static; height: auto; overflow: visible; }
    .workspace { overflow: visible; }
    .stats-grid, .front-grid, .feature-grid, .split-grid, .kv-grid, .management-shell, .check-grid, .roles-layout { grid-template-columns: 1fr; }
    .region-inline-row { grid-template-columns: 1fr; }
}

/* ===== Final Payment Records Table ===== */
.final-payment-records-wrap { width: 100%; }
.final-payment-records-table {
    width: 100%; border-collapse: collapse; margin-bottom: 10px;
    font-size: 13px; background: var(--panel); border-radius: 8px; overflow: hidden;
    border: 1px solid var(--line);
}
.final-payment-records-table th {
    background: var(--bg); padding: 8px 10px; text-align: left;
    font-weight: 600; color: var(--muted); font-size: 12px;
    border-bottom: 1px solid var(--line);
}
.final-payment-records-table td {
    padding: 6px 8px; border-bottom: 1px solid var(--line);
}
.final-payment-records-table tr:last-child td { border-bottom: none; }
.fp-input {
    width: 100%; border: 1px solid var(--line); border-radius: 4px;
    padding: 4px 8px; font-size: 13px; background: var(--panel); color: var(--text);
    transition: border-color 0.2s;
}
.fp-input:focus { border-color: var(--primary); outline: none; }
.fp-delete-btn {
    background: none; border: none; color: var(--danger); cursor: pointer;
    font-size: 13px; padding: 4px 8px; border-radius: 4px;
    transition: background 0.2s;
}
.fp-delete-btn:hover { background: rgba(255, 107, 107, 0.1); }
.fp-add-btn { margin-top: 4px; }
.fp-action-cell { white-space: nowrap; }
.fp-add-row-btn {
    background: none; border: none; color: var(--primary); cursor: pointer;
    font-size: 13px; padding: 4px 8px; border-radius: 4px;
    transition: background 0.2s;
}
.fp-add-row-btn:hover { background: rgba(0, 191, 255, 0.1); }

/* ===== Backend Params Page ===== */
/* ===== Backend Params (Grid + Chip) ===== */
.bp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px; margin-bottom: 16px;
}
.bp-card {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 10px; padding: 16px; display: flex;
    flex-direction: column;
}
.bp-card-head {
    display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.bp-card-icon { font-size: 22px; flex-shrink: 0; }
.bp-card-title { flex: 1; min-width: 0; }
.bp-card-title strong { display: block; font-size: 14px; margin-bottom: 2px; }
.bp-card-title span { font-size: 12px; color: var(--muted); }
.bp-reset-btn {
    background: none; border: 1px solid var(--line); cursor: pointer;
    font-size: 14px; padding: 4px 8px; border-radius: 6px; color: var(--muted);
    transition: all 0.15s; flex-shrink: 0;
}
.bp-reset-btn:hover { border-color: var(--primary); color: var(--primary); }

.bp-list { margin-bottom: 0; flex: 1; }
.bp-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0; border-bottom: 1px solid var(--line);
}
.bp-row:last-child { border-bottom: none; }
.bp-row-input {
    flex: 1; border: 1px solid transparent; border-radius: 4px;
    padding: 5px 8px; font-size: 14px; background: transparent;
    transition: border-color 0.15s, background 0.15s; min-width: 0;
}
.bp-row-input { color: var(--text); }
.bp-row-input:hover { background: rgba(0, 191, 255, 0.05); }
.bp-row-input:focus { border-color: var(--primary); background: var(--panel); outline: none; }
.bp-row-ops { display: flex; gap: 4px; flex-shrink: 0; }
.bp-op-btn {
    border: none; cursor: pointer; font-size: 13px; padding: 3px 10px;
    border-radius: 4px; transition: background 0.15s;
}
.bp-op-add { background: rgba(0, 191, 255, 0.1); color: var(--primary); }
.bp-op-add:hover { background: rgba(0, 191, 255, 0.2); }
.bp-op-del { background: rgba(255, 107, 107, 0.1); color: var(--danger); }
.bp-op-del:hover { background: rgba(255, 107, 107, 0.2); }

.bp-card-add { display: flex; gap: 6px; align-items: center; }
.bp-add-input {
    flex: 1; padding: 6px 10px; border: 1px solid var(--line);
    border-radius: 6px; font-size: 13px; min-width: 0; background: rgba(10, 25, 47, 0.6); color: var(--text);
}
.bp-add-input:focus { border-color: var(--primary); outline: none; }
.bp-add-btn {
    width: 32px; height: 32px; border-radius: 6px; border: none;
    background: var(--primary); color: #fff; font-size: 18px;
    cursor: pointer; flex-shrink: 0; display: inline-flex;
    align-items: center; justify-content: center;
    transition: background 0.15s;
}
.bp-add-btn:hover { filter: brightness(1.1); }

.bp-save-bar {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 10px; padding: 12px 0;
}
.bp-save-hint { color: #d97706; font-size: 13px; font-weight: 500; margin-right: auto; }

/* ===== Case History Cards ===== */
.case-summary-bar {
    display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.case-summary-item {
    flex: 1; min-width: 140px; background: var(--panel);
    border: 1px solid var(--line); border-radius: 10px;
    padding: 16px 20px; text-align: center;
    transition: box-shadow 0.2s;
}
.case-summary-item:hover { box-shadow: 0 0 16px rgba(0, 191, 255, 0.1); }
.case-summary-value {
    display: block; font-size: 22px; font-weight: 700; color: var(--primary);
    margin-bottom: 4px;
}
.case-summary-label { font-size: 12px; color: var(--muted); }
.case-filter-bar {
    display: flex; gap: 10px; align-items: center; margin-bottom: 20px;
    flex-wrap: wrap; padding: 12px 16px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.case-filter-bar .admin-input,
.case-filter-bar .admin-select {
    height: 36px; padding: 0 12px; border: 1px solid var(--line);
    border-radius: 8px; font-size: 14px; background: rgba(10, 25, 47, 0.6); color: var(--text); min-width: 160px;
    transition: border-color 0.2s;
}
.case-filter-bar .admin-input:focus,
.case-filter-bar .admin-select:focus { border-color: var(--primary); outline: none; }
.case-filter-bar .primary-btn,
.case-filter-bar .secondary-btn {
    height: 36px; padding: 0 16px; border-radius: 8px; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    white-space: nowrap; flex-shrink: 0;
}
.case-card-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.case-card {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 10px; overflow: hidden;
    transition: box-shadow 0.25s, transform 0.2s;
    display: flex; position: relative;
}
.case-card:hover { box-shadow: 0 0 24px rgba(0, 191, 255, 0.12); transform: translateY(-2px); }
.case-card-accent {
    width: 4px; flex-shrink: 0; background: var(--accent, var(--primary));
}
.case-card-inner { flex: 1; min-width: 0; }
.case-card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; border-bottom: 1px solid var(--line);
    background: var(--panel-soft);
}
.case-card-status {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 12px; font-weight: 600;
}
.case-card-status.status-completed { background: rgba(100, 255, 218, 0.12); color: #64FFDA; }
.case-card-status.status-verified { background: rgba(0, 191, 255, 0.12); color: #00BFFF; }
.case-card-date { font-size: 12px; color: var(--muted); }
.case-card-body { padding: 14px 16px; }
.case-card-title {
    margin: 0 0 6px; font-size: 15px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.case-card-amount {
    font-size: 18px; font-weight: 700; color: #FFD93D;
    margin-bottom: 10px;
}
.case-card-info { display: flex; flex-direction: column; gap: 5px; }
.case-info-row { display: flex; gap: 4px; font-size: 13px; align-items: center; }
.case-info-icon { font-size: 12px; flex-shrink: 0; width: 18px; text-align: center; }
.case-info-label { color: var(--muted); min-width: 60px; flex-shrink: 0; }
.case-loading, .case-empty {
    text-align: center; padding: 60px 40px; color: var(--muted);
    font-size: 15px; grid-column: 1 / -1;
}
.case-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.case-loading-spinner {
    width: 32px; height: 32px; border: 3px solid var(--line);
    border-top-color: var(--primary); border-radius: 50%;
    animation: case-spin 0.8s linear infinite;
}
@keyframes case-spin { to { transform: rotate(360deg); } }
.case-empty-icon { font-size: 48px; margin-bottom: 8px; }
.case-empty p { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--muted); }
.case-empty span { font-size: 13px; }
.pagination-ellipsis { padding: 0 4px; color: var(--muted); }
.admin-select {
    padding: 8px 12px; border: 1px solid var(--line);
    border-radius: 6px; font-size: 14px; background: var(--panel); color: var(--text);
}
.admin-select:focus { border-color: var(--primary); outline: none; }

/* ===== KPI Overview Cards ===== */
.kpi-overview { margin-bottom: 18px; }
.kpi-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; }
.kpi-card {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px; border-radius: 16px;
    background: var(--panel); border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.2s, transform 0.15s;
}
.kpi-card:hover { box-shadow: 0 0 24px rgba(0, 191, 255, 0.12); transform: translateY(-2px); }
.kpi-icon-wrap {
    width: 46px; height: 46px; border-radius: 12px;
    display: grid; place-items: center; flex-shrink: 0;
}
.kpi-emoji { font-size: 22px; }
.kpi-purple { background: rgba(139,92,246,0.12); }
.kpi-cyan { background: rgba(6,182,212,0.12); }
.kpi-red { background: rgba(239,68,68,0.12); }
.kpi-green { background: rgba(34,197,94,0.12); }
.kpi-blue { background: rgba(59,130,246,0.12); }
.kpi-orange { background: rgba(245,158,11,0.12); }
.kpi-deep-blue { background: rgba(31,120,209,0.12); }
.kpi-body { min-width: 0; }
.kpi-value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.2; }
.kpi-label { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; }

/* ===== Analysis Panels ===== */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 18px;
    margin-top: 18px;
}
.analysis-site-panel {
    background: linear-gradient(135deg, #0D2137, #112240);
    border-color: var(--primary);
    color: #fff;
    padding: 22px;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.1);
}
.analysis-site-panel .card-subtitle { color: rgba(255,255,255,0.7); }
.analysis-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.analysis-metric { text-align: center; }
.analysis-metric-value {
    font-size: 26px; font-weight: 700; color: #fff;
    margin-bottom: 4px;
}
.analysis-metric-label {
    font-size: 12px; color: rgba(255,255,255,0.75);
}
.analysis-trend-panel {
    padding: 22px;
    min-height: 280px;
}
.analysis-rate-panel {
    padding: 22px;
    display: flex;
    flex-direction: column;
}
.circular-progress-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: auto;
    justify-content: center;
}
.circular-progress-svg {
    flex-shrink: 0;
}
.circular-progress-legend {
    display: grid;
    gap: 12px;
}
.analysis-legend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-soft);
}
.analysis-legend-item span {
    font-size: 13px;
    color: var(--muted);
}
.analysis-legend-item strong {
    font-size: 18px;
    color: var(--text);
    font-weight: 700;
}

@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .analysis-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analysis-grid { grid-template-columns: 1fr; }
}

/* 主题风格卡片选择器 */
.theme-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.theme-picker-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border: 2px solid var(--line, #233554);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}
.theme-picker-card:hover {
    border-color: var(--primary, #00BFFF);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.theme-picker-card.is-active {
    border-color: var(--primary, #00BFFF);
    box-shadow: 0 0 0 2px var(--primary-soft, rgba(0,191,255,0.2)), 0 6px 20px rgba(0,0,0,0.25);
}
.theme-picker-colors {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border-radius: 8px 8px 0 0;
}
.theme-picker-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}
.theme-picker-label {
    display: block;
    text-align: center;
    padding: 6px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text, #CCD6F6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
