:root {
    --navy: #11182f;
    --navy-soft: #1a2542;
    --blue: #315c9e;
    --blue-light: #eaf1fc;
    --text: #183b67;
    --muted: #7192bb;
    --line: #d9e1ee;
    --green: #0caa88;
    --danger: #d95369;
    --warn: #df9c34;
    --content: #fff;
    --page: #fff;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--text); background: var(--page); font-family: Arial, "Microsoft YaHei", sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .btn-small, .primary, .btn-light, .outline-primary, .soft-green { cursor: pointer; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; color: #7892b4; background: var(--navy); border-right: 2px solid #4566ae; padding: 20px 16px; z-index: 5; display: flex; flex-direction: column; overflow: hidden; }
.brand { height: 68px; padding: 0 42px; display: flex; align-items: flex-start; flex: 0 0 auto; }
.brand-mark, .login-logo { color: #55b8f2; font-size: 31px; font-weight: 800; font-style: italic; letter-spacing: -2px; }
.sidebar-nav { min-height: 0; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #4566ae transparent; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #4566ae; border-radius: 6px; }
.nav-section { margin: 21px 24px 9px; font-size: 12px; font-weight: 700; letter-spacing: .2px; }
.nav-item { display: flex; gap: 12px; align-items: center; min-height: 45px; padding: 0 25px; border-radius: 26px; color: #7892b4; font-weight: 600; transition: background .15s, color .15s; }
.nav-item:hover, .nav-item.active { color: var(--blue); background: #fff; }
.nav-icon { width: 18px; text-align: center; font-size: 20px; }
.chevron { margin-left: auto; font-size: 18px; }
.subnav { display: none; padding: 5px 0 7px 59px; }
.nav-group.open .subnav { display: grid; gap: 2px; }
.subnav a { padding: 7px 0; color: #567aaf; font-size: 13px; }
.subnav a:hover { color: #fff; }
.main { min-height: 100vh; margin-left: 260px; display: flex; flex-direction: column; background: #fff; }
.topbar { height: 65px; display: flex; justify-content: flex-end; align-items: center; gap: 22px; padding: 0 38px; border-bottom: 1px solid #edf0f6; color: var(--text); font-size: 12px; }
.topbar-time { color: #345982; }
.topbar-links { display: flex; gap: 18px; align-items: center; }
.topbar-links a { color: #315e9c; }
.avatar { width: 33px; height: 33px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: #315b99; border-radius: 50%; font-size: 18px; }
.pending-link { display: inline-flex; align-items: center; gap: 6px; }
.notification-badge { display: inline-flex; min-width: 18px; height: 18px; align-items: center; justify-content: center; padding: 0 5px; color: #fff; background: #d95369; border-radius: 10px; font-size: 11px; font-weight: 700; }
.admin-profile-menu { position: relative; }
.profile-trigger { display: inline-flex; align-items: center; gap: 8px; padding: 0; color: var(--text); background: transparent; border: 0; cursor: pointer; }
.profile-trigger .avatar { flex: 0 0 33px; }
.profile-chevron { color: #789bc5; font-size: 15px; }
.profile-dropdown { position: absolute; top: calc(100% + 12px); right: 0; z-index: 20; display: none; min-width: 170px; padding: 7px; border: 1px solid var(--line); border-radius: 4px; background: #fff; box-shadow: 0 15px 35px rgba(21, 53, 96, .16); }
.profile-dropdown.is-open { display: grid; gap: 2px; }
.profile-dropdown a { display: block; padding: 10px 11px; color: #315e9c; border-radius: 3px; }
.profile-dropdown a:hover { background: #f2f6fc; }
.profile-code { display: grid; width: 100%; gap: 4px; padding: 9px 11px; color: #789bc5; text-align: left; border: 0; border-top: 1px solid #edf1f6; border-bottom: 1px solid #edf1f6; background: #fff; cursor: pointer; }
.profile-code:hover { background: #f2f6fc; }
.profile-code strong { color: #234a78; letter-spacing: 1px; }
.content { width: 100%; max-width: 1200px; flex: 1; margin: 0 auto; padding: 30px 38px 52px; }
.footer { min-height: 65px; padding: 25px 36px; border-top: 1px solid var(--line); color: #6c8fb8; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 0 0 30px; }
.page-head h1 { margin: 0; color: #234a78; font-size: 30px; line-height: 1.2; font-weight: 700; }
.page-head p { margin: 9px 0 0; color: #789bc5; }
.square-action { display: inline-flex; align-items: center; justify-content: center; width: 37px; height: 37px; color: #fff; background: var(--blue); border-radius: 3px; font-size: 27px; }
.refresh-tip { margin: -48px 0 37px; color: #e94d4d; text-align: right; font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.stat-card, .panel { border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.stat-card { min-height: 162px; padding: 23px 25px; }
.stat-title { color: #6f92bc; }
.stat-value { margin: 14px 0 21px; color: #163e6c; font-size: 24px; }
.stat-meta { display: flex; justify-content: space-between; color: #678ab6; line-height: 1.65; }
.notice { margin: -8px 0 22px; padding: 11px 15px; color: #176e55; background: #e8faf4; border: 1px solid #bdeadd; border-radius: 3px; }
.panel { margin-bottom: 26px; padding: 0; overflow: hidden; }
.panel.is-loading { position: relative; opacity: .68; pointer-events: none; }
.panel.is-loading::after { content: "加载中..."; position: absolute; right: 18px; bottom: 14px; padding: 6px 10px; color: #315c9e; background: #fff; border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 8px 18px rgba(24,59,103,.10); }
.panel > h2, .compact-form > h2, .sales-filter h2 { margin: 0; padding: 25px 25px 0; color: #234a78; font-size: 19px; }
.filter-bar { display: flex; gap: 10px; align-items: center; min-height: 75px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.modern-filter { flex-wrap: wrap; padding: 16px 22px; }
.back-icon { color: #5080bc; font-size: 24px; }
.filter-bar input { flex: 1; border: 0; outline: 0; color: var(--text); }
.modern-filter input, .modern-filter select { min-height: 39px; border: 1px solid #d4deec; border-radius: 3px; padding: 8px 11px; color: var(--text); background: #fff; outline: none; }
.modern-filter input { flex: 1 1 220px; }
.modern-filter input[type="date"] { flex: 0 0 148px; }
.modern-filter select { flex: 0 0 150px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6d8db5 50%), linear-gradient(135deg, #6d8db5 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.modern-filter .btn-light, .modern-filter button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.date-separator { color: #789bc5; }
.filter-bar input::placeholder, input::placeholder { color: #aac0dc; }
.filter-bar button, .btn-light { border: 1px solid var(--line); padding: 8px 18px; border-radius: 3px; color: var(--text); background: #fff; }
.filter-bar button { color: #fff; background: var(--navy-soft); border-color: var(--navy-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 12px; border-bottom: 1px solid var(--line); }
.chip { padding: 6px 10px; border-radius: 14px; color: #6688b4; background: #f1f5fa; font-size: 12px; }
.chip.green { color: #09a681; background: #e2fbf4; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #6387b3; font-weight: 500; white-space: nowrap; }
td { color: #315b8d; }
tbody tr:hover { background: #fbfdff; }
.team-tree-list { padding: 9px 22px 16px; }
.team-node { border-bottom: 1px solid #edf1f6; }
.team-node:last-child { border-bottom: 0; }
.team-node-row { display: flex; align-items: center; gap: 12px; min-height: 67px; padding: 9px 0; }
.team-node-child { margin-left: 28px; padding-left: 18px; border-left: 1px solid #d8e3f0; }
.team-toggle, .team-toggle-placeholder { flex: 0 0 27px; width: 27px; height: 27px; }
.team-toggle { display: inline-flex; align-items: center; justify-content: center; color: #315c9e; border: 1px solid #c9d8eb; border-radius: 3px; background: #f7faff; font-size: 17px; line-height: 1; }
.team-toggle:hover { color: #fff; background: #315c9e; border-color: #315c9e; }
.team-node-main { min-width: 190px; display: grid; gap: 4px; }
.team-node-main strong { color: #234a78; font-size: 14px; }
.team-node-main span, .team-node-summary { color: #8aa7c8; font-size: 12px; }
.team-node-meta { margin-left: auto; display: flex; align-items: center; gap: 18px; color: #6387b3; font-size: 12px; white-space: nowrap; }
.team-node-meta b { color: #234a78; }
.team-node-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0 0 11px 39px; }
.team-children { padding-bottom: 4px; }
.team-children.is-loading { min-height: 42px; opacity: .65; }
.team-children.is-loading::after { content: "加载中..."; display: block; padding: 10px 0 12px 45px; color: #6387b3; font-size: 12px; }
.team-load-more { margin: 4px 0 14px 45px; padding: 7px 12px; color: #315c9e; border: 1px solid #d4deec; border-radius: 3px; background: #fff; cursor: pointer; font-size: 12px; }
.team-load-more:hover { background: #f2f6fc; }
.team-tree-empty { padding: 15px 0 18px 45px; color: #8aa7c8; font-size: 12px; }
.muted { color: #91acce; font-size: 12px; }
.link { color: #3569ac; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 12px; font-size: 12px; white-space: nowrap; }
.badge.ok { color: #078666; background: #e2f8f2; }
.badge.warn { color: #b67b1c; background: #fff4dd; }
.badge.danger { color: #be4660; background: #ffe9ed; }
.pager { display: flex; align-items: center; gap: 5px; padding: 13px 20px; }
.pager button, .pager select { padding: 7px 12px; border: 0; border-radius: 3px; color: #fff; background: #9db3d1; }
.pager span { color: #5179aa; padding: 0 7px; }
.pager select { margin-left: auto; color: #365f91; background: #fff; border: 1px solid var(--line); }
.table-pager { justify-content: flex-end; border-top: 1px solid var(--line); }
.pager-disabled { display: inline-flex; align-items: center; min-height: 28px; padding: 6px 10px; color: #9ab1ce; background: #eef3fa; border-radius: 3px; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 21px; padding: 26px; }
.form-grid label, .compact-form label { display: grid; gap: 8px; color: #6488b5; }
.form-grid input, .form-grid select, .form-grid textarea, .compact-form input, .compact-form select, .compact-form textarea, .report-toolbar input, .report-toolbar select { min-height: 40px; padding: 9px 12px; color: var(--text); border: 1px solid #d4deec; border-radius: 3px; outline: none; background: #fff; }
.form-grid textarea, .compact-form textarea { min-height: 90px; resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .compact-form input:focus, .compact-form select:focus, .compact-form textarea:focus, .report-toolbar input:focus, .report-toolbar select:focus { border-color: #7296ca; box-shadow: 0 0 0 3px #edf3fc; }
.form-grid .wide { grid-column: 1 / -1; }
.permission-box { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid #dce6f2; border-radius: 4px; background: #f8fbff; color: #234a78; }
.permission-box small { color: #789bc5; line-height: 1.5; }
.role-description { min-height: 20px; padding: 8px 10px; color: #547aa8; border: 1px solid #dce6f2; border-radius: 3px; background: #fff; line-height: 1.5; }
.role-description strong { color: #234a78; }
.permission-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 14px; margin-top: 4px; }
.permission-item { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 7px !important; color: #456b96 !important; }
.permission-item input { min-height: 16px !important; width: 16px; margin: 0; accent-color: var(--blue); }
.switch-field { min-height: 40px; display: inline-flex; align-items: center; gap: 10px; }
.switch-field input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; width: 46px; height: 24px; border-radius: 12px; background: #cbd8e8; transition: background .16s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(29, 52, 86, .22); transition: transform .16s; }
.switch-field input:checked + .switch-ui { background: var(--blue); }
.switch-field input:checked + .switch-ui::after { transform: translateX(22px); }
.switch-field em { color: #6488b5; font-style: normal; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; padding-top: 7px; }
.primary, .outline-primary, .soft-green, .btn-small { border-radius: 3px; font-weight: 600; }
.primary { padding: 10px 21px; color: #fff; background: var(--blue); border: 1px solid var(--blue); }
.outline-primary { padding: 10px 21px; color: var(--blue); background: #fff; border: 1px solid var(--blue); }
.soft-green { padding: 10px 21px; color: #08a17f; background: #e4faf4; border: 1px solid #d5f3ea; }
.outline-danger { padding: 10px 21px; color: var(--danger); background: #fff; border: 1px solid #f0b8c3; border-radius: 3px; font-weight: 600; cursor: pointer; }
.head-actions { display: flex; gap: 10px; }
.breadcrumb { margin: 9px 0 14px; color: #8aa8cc; font-size: 12px; }
.chat-shell { min-height: 690px; display: grid; grid-template-columns: 300px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.chat-list { border-right: 1px solid var(--line); }
.chat-list h3 { padding: 15px; margin: 0; color: #345a88; }
.chat-search { width: calc(100% - 30px); margin: 0 15px 15px; padding: 11px 14px; border: 0; border-radius: 22px; color: var(--text); background: #f1f5fb; outline: none; }
.chat-item { display: flex; gap: 12px; align-items: center; margin: 0 9px 8px; padding: 12px; border: 1px solid transparent; border-radius: 11px; }
.chat-item.active, .chat-item:hover { border-color: #aebfff; background: #fbfdff; }
.chat-item strong, .chat-title strong { display: block; color: #315b8f; }
.chat-item small, .chat-title small { display: block; margin-top: 5px; color: #91acce; font-size: 11px; }
.chat-avatar { display: inline-flex; flex: 0 0 42px; align-items: center; justify-content: center; width: 42px; height: 42px; color: #fff; background: #7685ff; border-radius: 12px; font-weight: 700; }
.chat-room { display: grid; grid-template-rows: 75px minmax(330px, 1fr) 78px; min-width: 0; }
.chat-title { display: flex; gap: 12px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.chat-messages { padding: 20px; overflow-y: auto; background-color: #f4f7fd; background-image: radial-gradient(#dce6f6 1px, transparent 1px); background-size: 18px 18px; }
.bubble { max-width: 70%; margin-bottom: 16px; }
.bubble span { display: inline-block; padding: 11px 14px; border-radius: 12px; color: #315b8d; background: #fff; box-shadow: 0 3px 12px rgba(53, 82, 130, .06); }
.bubble small { display: block; margin-top: 5px; color: #93acce; font-size: 11px; }
.bubble.right { margin-left: auto; text-align: right; }
.bubble.right span { color: #fff; background: #637bff; }
.chat-compose { display: flex; gap: 10px; align-items: center; padding: 13px 18px; border-top: 1px solid var(--line); background: #fff; }
.chat-compose input { flex: 1; min-width: 0; padding: 13px 16px; border: 1px solid #e0e7f0; border-radius: 25px; outline: none; }
.chat-compose button { padding: 12px 23px; border: 0; border-radius: 25px; color: #fff; background: #617bff; }
.report-toolbar { display: grid; grid-template-columns: 1fr 2fr 150px; gap: 28px; padding: 20px 25px 27px; }
.report-toolbar.wide-toolbar { display: grid; grid-template-columns: 150px minmax(220px, 1fr) 155px 155px auto auto; gap: 12px; align-items: center; border-bottom: 0; }
.sales-filter { max-width: 100%; }
.panel-title-row { display: flex; justify-content: space-between; align-items: center; padding: 22px 25px 0; }
.panel-title-row h2 { margin: 0; color: #234a78; font-size: 19px; }
.green-text, .amount { color: var(--green); }
.danger-text { color: var(--danger); }
.compact-form { padding-bottom: 24px; }
.compact-form .form-grid { padding: 24px 25px 10px; }
.settings-form { display: grid; gap: 0; }
.settings-section .form-grid { padding-top: 18px; }
.settings-sticky-actions { position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: flex-end; padding: 14px 0 0; background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0)); }
.settings-section-actions { display: flex; justify-content: flex-end; padding: 0 25px 24px; }
.setting-help-block { padding: 13px 14px; color: #6c8fb8; background: #f5f8fc; border: 1px solid #dbe5f2; border-radius: 3px; line-height: 1.65; }
.form-grid small, .compact-form small { color: #91acce; line-height: 1.45; }
.image-upload-field, .single-image-field { display: grid; gap: 10px; padding: 14px; border: 1px solid #dbe5f2; border-radius: 4px; background: #fbfdff; }
.image-upload-title { color: #6488b5; font-weight: 600; }
.image-json-value { display: none; }
.image-preview-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; min-height: 48px; align-items: center; }
.image-preview-card { position: relative; min-height: 96px; border: 1px solid #d8e1ee; border-radius: 4px; overflow: hidden; background: #fff; }
.image-preview-card img { width: 100%; height: 110px; object-fit: contain; display: block; background: #f4f7fb; }
.image-preview-card button { position: absolute; right: 6px; top: 6px; border: 0; border-radius: 3px; padding: 3px 6px; color: #fff; background: rgba(217,83,105,.92); font-size: 12px; }
.image-upload-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.image-select-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; overflow: hidden; }
.image-select-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.single-image-preview { min-height: 86px; display: flex; align-items: center; justify-content: center; border: 1px dashed #cbd8e8; border-radius: 4px; background: #fff; overflow: hidden; }
.single-image-preview img { max-width: 100%; max-height: 180px; object-fit: contain; display: block; }
.setting-image-field { margin-top: 8px; }
.media-list-field { display: grid; gap: 12px; margin-top: 8px; padding: 14px; border: 1px solid #dbe5f2; border-radius: 4px; background: #fbfdff; }
.media-list-textarea { min-height: 96px; font-family: Consolas, Monaco, monospace; resize: vertical; }
.media-preview-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; min-height: 58px; }
.media-preview-card { overflow: hidden; border: 1px solid #d8e1ee; border-radius: 4px; background: #fff; }
.media-preview-card img, .media-preview-card video { display: block; width: 100%; height: 118px; object-fit: contain; background: #f4f7fb; }
.media-preview-card span { display: block; padding: 7px 8px; color: #6488b5; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 26px; align-items: start; }
.wallet-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; padding: 24px 25px 26px; background: var(--line); }
.wallet-summary div { min-height: 92px; padding: 18px 20px; background: #fff; }
.wallet-summary span { display: block; color: #7c9cc3; font-size: 12px; }
.wallet-summary strong { display: block; margin-top: 12px; color: #234a78; font-size: 22px; font-weight: 700; }
.quick-actions { display: grid; gap: 14px; padding: 24px 25px 26px; }
.quick-actions form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.quick-actions input { min-height: 40px; padding: 9px 12px; color: var(--text); border: 1px solid #d4deec; border-radius: 3px; outline: none; background: #fff; }
.security-actions form { grid-template-columns: minmax(220px, 380px) auto; justify-content: start; }
.security-actions input { width: 100%; }
.product-cell { display: flex; gap: 10px; align-items: center; width: 280px; min-width: 280px; }
.product-thumb { width: 48px; height: 48px; flex: 0 0 48px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #f7f9fc; }
.product-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-name-trigger { min-width: 0; max-width: 220px; padding: 0; overflow: hidden; color: #234a78; border: 0; outline: 0; background: transparent; font: inherit; font-weight: 600; line-height: 1.45; text-align: left; cursor: pointer; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-name-trigger:hover { color: var(--blue); text-decoration: underline; }
.admin-modal__panel--product-name { width: min(560px, calc(100vw - 34px)); }
.product-name-detail { padding: 22px 24px 26px; }
.product-name-detail .modal-detail-list { margin: 0; }
.product-name-detail .modal-detail-list div { display: block; padding: 0; border: 0; }
.product-name-detail .modal-detail-list dt { margin-bottom: 9px; color: #7c9cc3; font-size: 12px; }
.product-name-detail .modal-detail-list dd { margin: 0; color: #234a78; font-size: 15px; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; }
.truncate { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-small { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 6px 10px; color: #fff; background: #8198ba; border: 0; font-size: 12px; line-height: 1.2; }
.btn-small.primary { background: var(--blue); }
.btn-small.danger { margin-left: 4px; background: var(--danger); }
.actions-cell { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; min-width: 220px; }
.actions-cell .btn-small { flex: 0 0 auto; height: 32px; min-height: 32px; padding: 0 10px; white-space: nowrap; }
.actions-cell .btn-small.primary { padding: 0 10px; }
.actions-cell form { display: inline-flex; margin: 0; }
.actions-cell .btn-small.danger { margin-left: 0; border: 0; }
.actions-cell button.btn-small { border: 0; }
.detail-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; padding: 24px 25px 26px; background: var(--line); }
.detail-list div { min-height: 72px; padding: 13px 14px; background: #fff; }
.detail-list span { display: block; margin-bottom: 8px; color: #7c9cc3; font-size: 12px; }
.detail-list strong { color: #234a78; font-weight: 600; overflow-wrap: anywhere; }
.empty { padding: 35px; color: #8ca7c8; text-align: center; }
.login-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(45deg, #35394a 0%, #1f222e 100%); }
.login-panel { width: min(440px, calc(100% - 30px)); padding: 42px 44px 45px; color: #a4a6b3; background: #292d3c; border-top: 2px solid #0097af; box-shadow: 0 20px 40px rgba(0, 0, 0, .3); }
.login-logo { margin-bottom: 25px; }
.login-panel h1 { margin: 0; color: #dedede; font-size: 25px; font-weight: 400; }
.login-panel p { margin: 10px 0 28px; color: #8f95a7; }
.login-panel label { display: grid; gap: 7px; margin-top: 15px; }
.login-panel input { width: 100%; padding: 12px 13px; color: #e4e8f0; background: #232735; border: 1px solid #40465a; outline: none; }
.login-panel button { width: 100%; margin-top: 27px; padding: 13px; border: 0; color: #fff; background: #0097af; font-weight: 700; }
.login-error { padding: 10px 12px; color: #ffb5bd; background: #4c2935; border: 1px solid #784250; }
.modal-open { overflow: hidden; }
.admin-modal { position: fixed; inset: 0; display: none; z-index: 50; }
.admin-modal.is-open { display: block; }
.admin-modal__mask { position: absolute; inset: 0; background: rgba(17, 24, 47, .45); }
.admin-modal__panel { position: absolute; top: 7vh; left: 50%; width: min(760px, calc(100vw - 34px)); max-height: 86vh; overflow-y: auto; transform: translateX(-50%); background: #fff; border-radius: 4px; box-shadow: 0 24px 60px rgba(20, 42, 74, .26); }
.admin-modal__panel--wide { width: min(920px, calc(100vw - 34px)); }
.admin-modal__head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.admin-modal__head h2 { margin: 0; color: #234a78; font-size: 18px; }
.modal-close { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 3px; color: #567aaf; background: #fff; font-size: 20px; line-height: 1; }
.modal-detail { padding: 22px 24px 28px; }
.modal-detail-list { display: grid; gap: 12px; margin: 0; }
.modal-detail-list div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding-bottom: 12px; border-bottom: 1px solid #edf1f6; }
.modal-detail-list dt { color: #789bc5; }
.modal-detail-list dd { margin: 0; color: #234a78; white-space: pre-wrap; overflow-wrap: anywhere; }
.progress-link { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0; color: #31598e; background: transparent; border: 0; cursor: pointer; text-align: left; }
.progress-link strong { font-size: 15px; line-height: 1.2; }
.progress-link span { color: #789bc5; font-size: 12px; }
.progress-link:hover strong, .progress-link:focus-visible strong { color: #1f477e; text-decoration: underline; }
.status-line { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mini-status { display: inline-flex; align-items: center; padding: 2px 6px; color: #617b9f; background: #f2f5fa; border-radius: 3px; font-size: 11px; line-height: 1.2; }
.mini-status.on { color: #14735a; background: #e7f8f1; }
.mini-status.off { color: #b33955; background: #fff0f3; }
.admin-modal__panel--task-overview { width: min(1180px, calc(100vw - 34px)); max-height: 90vh; }
.admin-modal__panel--team { width: min(1120px, calc(100vw - 34px)); max-height: 90vh; }
.admin-modal__panel--team-commission { width: min(920px, calc(100vw - 34px)); max-height: 86vh; }
.admin-modal__panel--combo-product-preview { width: min(760px, calc(100vw - 34px)); max-height: 86vh; }
.admin-modal__panel--recharge { width: min(680px, calc(100vw - 34px)); max-height: 88vh; }
.admin-modal__panel--recharge .compact-form { display: grid; gap: 18px; padding: 24px 30px 30px; }
.admin-modal__panel--recharge .compact-form label { gap: 8px; color: #5579a8; font-size: 13px; }
.admin-modal__panel--recharge .compact-form input,
.admin-modal__panel--recharge .compact-form textarea { box-sizing: border-box; width: 100%; }
.admin-modal__panel--recharge .compact-form textarea { min-height: 140px; line-height: 1.5; }
.admin-modal__panel--recharge .compact-form .form-actions { margin-top: 2px; padding-top: 16px; border-top: 1px solid #edf1f6; }
.admin-modal--nested { z-index: 70; }
.admin-modal__panel--rule-editor { width: min(1080px, calc(100vw - 34px)); top: 5vh; max-height: 90vh; }
.task-rule-editor-form { padding: 22px 24px 26px; }
.rule-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rule-editor-grid > label, .task-rule-fields > label { display: grid; gap: 7px; min-width: 0; color: #617b9f; font-size: 12px; }
.rule-editor-grid > label.wide, .task-rule-editor-form .form-actions { grid-column: 1 / -1; }
.rule-editor-grid input, .rule-editor-grid select { width: 100%; min-width: 0; height: 40px; padding: 0 11px; color: #234a78; background: #fff; border: 1px solid #cfdaea; border-radius: 4px; outline: 0; }
.rule-editor-grid input:focus, .rule-editor-grid select:focus { border-color: #5f82b6; box-shadow: 0 0 0 3px rgba(65, 99, 157, .1); }
.combo-product-filter { display: grid; grid-template-columns: minmax(180px, 1fr) 150px auto 150px auto; gap: 10px; align-items: end; padding: 13px 14px; border: 1px solid #dbe5f2; border-radius: 4px; background: #f8fbff; }
.combo-product-filter > div { align-self: center; }
.combo-product-filter strong, .combo-product-filter small { display: block; }
.combo-product-filter strong { color: #31598e; }
.combo-product-filter small { margin-top: 4px; color: #789bc5; }
.combo-product-filter label { display: grid; gap: 5px; color: #617b9f; font-size: 12px; }
.combo-filter-separator { align-self: center; padding-top: 18px; color: #91acce; }
.combo-filter-result { align-self: center; padding-top: 18px; color: #31598e; font-size: 12px; white-space: nowrap; }
.combo-product-editor { display: grid; gap: 10px; padding: 13px 14px; border: 1px solid #dbe5f2; border-radius: 4px; background: #f8fbff; }
.combo-product-editor-head { display: grid; gap: 4px; color: #31598e; }
.combo-product-editor-head small { color: #789bc5; }
.combo-product-editor [data-combo-products] { display: grid; gap: 12px; }
.combo-product-card { overflow: hidden; border: 1px solid #dce6f2; border-radius: 4px; background: #fff; }
.combo-product-card-head { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; color: #31598e; background: #f1f6fc; border-bottom: 1px solid #e2eaf4; }
.combo-product-card-head strong { font-size: 13px; }
.combo-product-card-head span { color: #789bc5; font-size: 11px; }
.combo-product-row { display: grid; grid-template-columns: minmax(240px, 1.7fr) repeat(3, minmax(105px, .7fr)); gap: 10px; align-items: end; padding: 12px; }
.combo-product-row label { display: grid; gap: 5px; min-width: 0; color: #617b9f; font-size: 11px; }
.combo-product-row input, .combo-product-row select { width: 100%; min-width: 0; min-height: 36px; padding: 7px 8px; color: var(--text); border: 1px solid #d4deec; border-radius: 3px; background: #fff; outline: none; }
.combo-product-row input:focus, .combo-product-row select:focus { border-color: #7296ca; box-shadow: 0 0 0 3px #edf3fc; }
.combo-product-row input[readonly] { color: #55779f; background: #f4f7fb; cursor: default; }
.task-rule-fields { display: contents; }
.task-rule-fields[style*="display: none"] { display: none; }
.task-rule-fields .wide { grid-column: 1 / -1; }
.task-rule-editor-form .form-actions { margin-top: 4px; padding-top: 16px; border-top: 1px solid #edf1f6; }
.compact-action { padding: 8px 14px; white-space: nowrap; }
.section-note { align-self: center; color: #789bc5; font-size: 12px; white-space: nowrap; }
.rule-summary-line { display: flex; flex-wrap: wrap; gap: 18px; margin: -2px 0 14px; color: #789bc5; font-size: 12px; }
.rule-summary-line strong { color: #31598e; font-size: 15px; }
.rule-table th, .rule-table td { padding: 12px 13px; }
.rule-table .actions-cell { white-space: nowrap; }
.combo-product-cell { width: 260px; min-width: 260px; max-width: 260px; }
.combo-product-summary { display: flex; width: 100%; min-width: 0; align-items: center; gap: 8px; padding: 4px 6px; color: #31598e; background: #f8fbff; border: 1px solid #dbe5f2; border-radius: 4px; cursor: pointer; text-align: left; }
.combo-product-summary:hover, .combo-product-summary:focus-visible { background: #f0f6ff; border-color: #9bb8dc; outline: 0; }
.combo-product-preview-list { display: flex; min-width: 0; gap: 7px; }
.combo-product-preview-item { display: inline-flex; min-width: 0; max-width: 94px; align-items: center; gap: 5px; }
.combo-product-preview-thumb { position: relative; display: inline-flex; flex: 0 0 30px; width: 30px; height: 30px; align-items: center; justify-content: center; overflow: hidden; border: 1px solid #dce6f2; border-radius: 3px; background: #fff; color: #91acce; font-size: 9px; }
.combo-product-preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.combo-product-sequence { position: absolute; right: 1px; bottom: 1px; min-width: 13px; padding: 1px 2px; color: #fff; background: rgba(35, 74, 120, .82); border-radius: 2px; font-size: 9px; line-height: 1; text-align: center; }
.combo-product-preview-name { min-width: 0; overflow: hidden; color: #31598e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.combo-product-more { flex: 0 0 auto; padding: 3px 5px; color: #31598e; background: #e8f1fc; border-radius: 3px; font-size: 11px; font-weight: 700; }
.combo-product-summary-count { flex: 0 0 auto; margin-left: auto; color: #789bc5; font-size: 11px; white-space: nowrap; }
.combo-product-preview-body { padding: 20px 24px 28px; }
.combo-product-preview-list-full { display: grid; gap: 10px; }
.combo-product-preview-card { display: grid; grid-template-columns: 30px 58px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; border: 1px solid #e1e8f2; border-radius: 4px; background: #fbfcfe; }
.combo-product-preview-order { display: grid; width: 28px; height: 28px; place-items: center; color: #31598e; background: #e8f1fc; border-radius: 50%; font-size: 12px; font-weight: 700; }
.combo-product-preview-large-thumb { display: inline-flex; width: 58px; height: 58px; align-items: center; justify-content: center; overflow: hidden; border: 1px solid #dce6f2; border-radius: 4px; background: #fff; color: #91acce; font-size: 10px; text-align: center; }
.combo-product-preview-large-thumb img { width: 100%; height: 100%; object-fit: cover; }
.combo-product-preview-info { min-width: 0; }
.combo-product-preview-info > strong { display: block; overflow: hidden; color: #234a78; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.combo-product-preview-meta { display: flex; flex-wrap: wrap; gap: 7px 18px; margin-top: 8px; color: #789bc5; font-size: 11px; }
.combo-product-preview-meta b { color: #31598e; font-weight: 700; }
.table-action-link { padding: 0; color: #3569ac; background: transparent; border: 0; cursor: pointer; font-size: 12px; }
.table-action-link + .table-action-link { margin-left: 10px; }
.table-action-link:hover, .table-action-link:focus-visible { text-decoration: underline; }
.table-action-link.danger { color: var(--danger); }
.badge.info { color: #2c70a9; background: #e6f3ff; }
.table-subtext { display: block; margin-top: 4px; color: #91acce; font-size: 11px; }
.task-product-cell { display: flex; gap: 10px; align-items: center; min-width: 230px; }
.task-product-cell > span:last-child { min-width: 0; }
.task-product-cell strong, .task-product-cell small { display: block; }
.task-product-cell small { margin-top: 3px; color: #789bc5; font-size: 11px; }
.task-product-description { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-product-thumb { display: inline-flex; flex: 0 0 42px; width: 42px; height: 42px; align-items: center; justify-content: center; overflow: hidden; border: 1px solid #e1e8f2; border-radius: 4px; background: #f7f9fc; color: #91acce; font-size: 11px; }
.task-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.task-product-placeholder { padding: 2px; text-align: center; }
.task-product-name-cell { width: 240px; max-width: 240px; }
.task-product-name-trigger { display: block; width: 220px; max-width: 220px; min-width: 0; padding: 0; overflow: hidden; color: #234a78; border: 0; outline: 0; background: transparent; font: inherit; line-height: 1.45; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.task-product-name-trigger:hover { color: var(--blue); text-decoration: underline; }
.rule-unset td { color: #9ab1ce; background: #fcfdff; }
.rule-unset .table-action-link { color: #31598e; }
.modal-subtitle { margin: 4px 0 0; color: #789bc5; font-size: 12px; font-weight: 400; }
.task-overview-body { padding: 20px 24px 28px; color: #234a78; }
.task-overview-loading { min-height: 260px; display: grid; place-items: center; color: #789bc5; }
.task-overview-error { min-height: 180px; display: grid; place-items: center; }
.task-overview-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.task-overview-summary > div { min-width: 0; padding: 14px 16px; border: 1px solid #e1e8f2; border-radius: 6px; background: #fbfcfe; }
.task-overview-summary span, .task-overview-summary small { display: block; color: #789bc5; font-size: 12px; }
.task-overview-summary strong { display: block; margin: 6px 0 4px; color: #234a78; font-size: 18px; overflow-wrap: anywhere; }
.team-overview-body { padding: 20px 24px 28px; color: #234a78; }
.team-overview-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.team-overview-summary > div { min-width: 0; padding: 14px 16px; border: 1px solid #e1e8f2; border-radius: 6px; background: #fbfcfe; }
.team-overview-summary span, .team-overview-summary small { display: block; color: #789bc5; font-size: 12px; }
.team-overview-summary strong { display: block; margin: 6px 0 4px; color: #234a78; font-size: 18px; overflow-wrap: anywhere; }
.team-level-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.team-level-filter button { min-height: 32px; padding: 0 13px; color: #5d7ea8; background: #f7faff; border: 1px solid #d7e2ef; border-radius: 4px; cursor: pointer; font-size: 12px; }
.team-level-filter button:hover, .team-level-filter button.is-active { color: #fff; background: #315c9e; border-color: #315c9e; }
.team-overview-table { min-width: 860px; }
.team-overview-table td strong, .team-overview-table td small { display: block; }
.task-reset-button { display: inline-flex; min-height: 28px; align-items: center; justify-content: center; margin-top: 10px; padding: 4px 10px; color: #b54747; background: #fff7f7; border: 1px solid #e6b6b6; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 700; }
.task-reset-button:hover { color: #943434; background: #ffeded; border-color: #d99898; }
.task-reset-button:disabled { cursor: wait; opacity: .65; }
.task-overview-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.task-overview-tabs button { position: relative; padding: 0 0 12px; color: #789bc5; background: transparent; border: 0; cursor: pointer; font-size: 15px; font-weight: 700; }
.task-overview-tabs button.is-active { color: #31598e; }
.task-overview-tabs button.is-active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: #3b5f9e; content: ''; }
.task-overview-section { min-width: 0; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-heading h3 { margin: 0; color: #31598e; font-size: 17px; }
.section-heading p { margin: 5px 0 0; color: #789bc5; font-size: 12px; }
.task-overview-table { min-width: 860px; }
.task-rule-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; padding: 16px; border: 1px solid #e1e8f2; border-radius: 6px; background: #fbfcfe; }
.task-rule-form label { display: grid; gap: 6px; color: #617b9f; font-size: 12px; }
.task-rule-form label.wide, .task-rule-form .form-actions { grid-column: 1 / -1; }
.task-rule-form input, .task-rule-form select { min-width: 0; width: 100%; height: 38px; padding: 0 10px; color: #234a78; background: #fff; border: 1px solid #cfdaea; border-radius: 4px; outline: 0; }
.task-rule-form input:focus, .task-rule-form select:focus { border-color: #5f82b6; box-shadow: 0 0 0 3px rgba(65, 99, 157, .1); }
.task-overview-table .actions-cell { min-width: 130px; }
.task-overview-pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 14px; color: #789bc5; font-size: 12px; }
.task-overview-pager button { padding: 6px 10px; color: #31598e; background: #fff; border: 1px solid #cfdaea; border-radius: 4px; cursor: pointer; }
.task-overview-pager button:hover { background: #f2f6fc; }
.toast-wrap { position: fixed; top: 18px; right: 22px; z-index: 80; display: grid; gap: 10px; }
.admin-toast { min-width: 220px; max-width: 360px; padding: 11px 14px; color: #176e55; background: #e8faf4; border: 1px solid #bdeadd; border-radius: 4px; box-shadow: 0 10px 26px rgba(24, 59, 103, .14); transition: opacity .18s, transform .18s; }
.admin-toast.leaving { opacity: 0; transform: translateY(-6px); }
@media (max-width: 1000px) {
    .sidebar { width: 220px; }
    .main { margin-left: 220px; }
    .topbar { gap: 10px; padding: 0 18px; }
    .topbar-time { display: none; }
    .topbar-links { gap: 9px; }
    .content { padding: 25px 20px 45px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .sidebar { position: static; width: 100%; min-height: auto; border-right: 0; }
    .brand { height: 50px; padding-left: 20px; }
    .sidebar-nav { max-height: calc(100vh - 88px); overflow-y: auto; }
    .main { margin-left: 0; }
    .topbar { height: auto; min-height: 58px; flex-wrap: wrap; justify-content: flex-start; padding: 10px 15px; }
    .topbar-links { flex-wrap: wrap; }
    .content { padding: 22px 15px 35px; }
    .page-head h1 { font-size: 25px; }
    .stats-grid, .form-grid, .report-toolbar, .report-toolbar.wide-toolbar, .detail-grid, .detail-list, .wallet-summary, .permission-list { grid-template-columns: 1fr; }
    .team-node-child { margin-left: 12px; padding-left: 10px; }
    .team-node-row { align-items: flex-start; }
    .team-node-main { flex: 1; min-width: 0; }
    .team-node-meta { margin-left: 0; flex-wrap: wrap; gap: 8px 14px; }
    .form-grid .wide, .form-actions { grid-column: auto; }
    .modern-filter input, .modern-filter select, .modern-filter input[type="date"] { flex: 1 1 100%; }
    .date-separator { display: none; }
    .admin-modal__panel { top: 20px; width: calc(100vw - 24px); max-height: calc(100vh - 40px); }
    .modal-detail-list div { grid-template-columns: 1fr; }
    .admin-modal__panel--task-overview, .admin-modal__panel--team { width: calc(100vw - 24px); }
    .admin-modal__panel--team-commission, .admin-modal__panel--recharge { width: calc(100vw - 24px); }
    .task-overview-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .team-overview-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .task-rule-form { grid-template-columns: 1fr; }
    .task-rule-form label.wide, .task-rule-form .form-actions { grid-column: auto; }
    .admin-modal__panel--rule-editor { width: calc(100vw - 24px); }
    .rule-editor-grid { grid-template-columns: 1fr; }
    .rule-editor-grid > label.wide, .task-rule-editor-form .form-actions, .task-rule-fields .wide { grid-column: auto; }
    .combo-product-filter { grid-template-columns: 1fr 1fr; }
    .combo-product-filter > div, .combo-filter-result { grid-column: 1 / -1; }
    .combo-filter-separator { display: none; }
    .combo-filter-result { padding-top: 0; }
    .combo-product-row { grid-template-columns: 1fr 1fr; }
    .combo-product-select { grid-column: 1 / -1; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .section-note { align-self: flex-start; }
    .quick-actions form { grid-template-columns: 1fr; }
    .chat-shell { grid-template-columns: 1fr; }
    .chat-list { max-height: 250px; border-right: 0; border-bottom: 1px solid var(--line); }
    .chat-room { min-height: 600px; }
    .footer { padding: 20px 15px; }
}
