:root { color-scheme: light; --page: #f5f7fb; --surface: #fff; --side: #13213a; --ink: #151c2e; --muted: #536078; --line: #dfe4ed; --soft: #f1f4f9; --brand: #244bd8; --brand-hover: #173ac0; --brand-soft: #edf0ff; --success: #197247; --success-soft: #e5f6ec; --danger: #a5243b; font: 14px/1.5 Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif; color: var(--ink); background: var(--page); }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
body:has(#sidebar:not([hidden])) { display: grid; grid-template-columns: 214px minmax(0,1fr); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.sidebar { position: sticky; top: 0; min-height: 100vh; max-height: 100dvh; display: flex; flex-direction: column; gap: 26px; padding: 24px 14px 14px; background: var(--side); color: #f1f5fc; }
.brand { color: var(--ink); display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; text-decoration: none; white-space: nowrap; }
.sidebar .brand { padding-inline: 9px; color: inherit; }
.sidebar .film-icon { border-color: #a8baff; width: 21px; }
.film-icon { display: inline-block; height: 21px; width: 23px; border: 2px solid var(--brand); border-inline-width: 5px; border-radius: 4px; position: relative; }
.film-icon::after { content: ""; position: absolute; inset: 5px 0; border-block: 1px solid var(--brand); }
.tabs { display: grid; gap: 21px; overflow: auto; align-content: start; }
.nav-group { display: grid; gap: 3px; }
.nav-group > p { padding-inline: 10px; margin: 0 0 4px; color: #a5b4ce; font-size: 11px; font-weight: 650; }
.tabs button { display: block; text-align: left; padding: 9px 10px; border-color: transparent; background: transparent; color: #e0e9fa; min-height: 38px; font-size: 13px; }
.tabs button[aria-current="page"] { background: #3d5290; border-color: #6884cf; color: #fff; }
.tabs button:hover:not([aria-current]) { background: #253859; }
.sidebar-account { margin-top: auto; display: grid; grid-template-columns: 26px minmax(0,1fr) auto; gap: 7px; align-items: center; padding: 9px 6px; border-top: 1px solid #394b6d; }
.sidebar-account strong,.sidebar-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { font-size: 12px; }
.sidebar-account small { color: #b2bfd7; font-size: 10px; }
.admin-initial { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: #405991; color: #fff; }
.logout { min-height: 27px; padding: 3px 6px; color: #d5e1f7; border-color: #435674; background: transparent; }
.logout:hover { background: #263858; }
.workspace { min-width: 0; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 79px; padding: 13px clamp(16px,2.5vw,34px); background: var(--surface); border-bottom: 1px solid var(--line); }
.page-heading { display: grid; gap: 2px; }
.page-heading p { color: var(--muted); }
.page-actions { display: flex; gap: 8px; }
.page-content { padding: 21px clamp(16px,2.5vw,34px) 40px; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: clamp(19px,2.3vw,23px); letter-spacing: -.02em; }
h2 { font-size: 17px; font-weight: 720; }
h3 { font-size: 14px; }
small,p,label,summary,.table-footer { color: var(--muted); }
p,small { font-size: 12px; line-height: 1.55; }
.stack { display: grid; gap: 15px; align-content: start; }
.panel { min-width: 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 6px #20335e08; }
.table-panel { padding: 15px; }
.login { width: min(100% - 28px, 390px); margin: clamp(35px, 13vh, 130px) auto; }
.login .brand { margin-bottom: 17px; }
.login .panel { padding: 24px; }
.bar,.toolbar,.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bar { justify-content: space-between; }
.toolbar { gap: 10px; }
.toolbar-end { margin-left: auto; }
.inline-label { font-size: 13px; }
.search { width: min(100%, 350px); flex: 1 1 200px; }
.catalog-toolbar .search { width: auto; }
.page-header button { min-height: 35px; padding-inline: 15px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,166px),1fr)); gap: 12px; }
label { display: grid; gap: 5px; font-size: 12px; }
input,textarea,select,button,.button { font: inherit; border-radius: 7px; }
input,textarea,select { padding: 7px 9px; border: 1px solid #d4dce8; background: var(--surface); color: var(--ink); min-width: 0; min-height: 35px; font-size: 13px; }
label input, label select, textarea { width: 100%; }
textarea { resize: vertical; }
input::placeholder { color: #626f83; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 15px; min-height: 15px; accent-color: var(--brand); }
button,.button { cursor: pointer; padding: 6px 10px; min-height: 32px; color: var(--ink); border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 650; line-height: 1.4; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
button:hover,.button:hover { background: var(--soft); }
button.primary { color: #fff; background: var(--brand); border-color: var(--brand); }
button.primary:hover { background: var(--brand-hover); }
button.danger { color: var(--danger); }
button.danger-fill { background: var(--danger); color: #fff; border-color: var(--danger); }
button:disabled { cursor: default; opacity: .54; }
button.outline { color: var(--brand-hover); border-color: #aebcf6; }
button.link-btn { color: var(--brand-hover); border-color: transparent; padding-inline: 5px; }
button.link-btn.danger { color: var(--danger); }
:focus-visible { outline: 2px solid #3764ed; outline-offset: 2px; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.provider-tabs button { padding-inline: 21px; min-height: 36px; }
.segmented button[aria-pressed="true"] { color: var(--brand-hover); background: var(--brand-soft); border-color: #97a6fa; }
.model-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(310px,1fr); align-items: start; gap: 13px; }
.slot-list { display: grid; gap: 9px; }
.model-slot { border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: minmax(0,1.55fr) minmax(91px,1fr); gap: 9px; align-items: end; padding: 10px; }
.model-slot label { min-width: 0; }
details { min-width: 0; }
summary { cursor: pointer; font-weight: 650; font-size: 13px; }
.detail-content { padding-top: 12px; }
.tag { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 650; border-radius: 5px; padding: 2px 6px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.tag.active { background: var(--success-soft); color: var(--success); }
.tag.revoked { background: #faedf0; color: var(--danger); }
.tag.role-owner { color:#4d3296;background:#eee8fb; }
.tag.role-operator { color:#2457ae;background:#e7f0ff; }
.tag.role-finance { color:#13725e;background:#e1f4eb; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); gap: 13px; }
.role-card { display:grid; justify-items:start; align-content:start; gap: 8px; padding:16px 17px; }
.administrator-table { min-width: 530px; }
input[readonly] { background: var(--soft); color: var(--muted); }
#administrator-edit-note { padding: 9px 10px; border-radius: 7px; background: var(--soft); }
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 13px; text-align: left; }
.catalog-table { min-width: 540px; }
.catalog-table td:last-child .actions { flex-wrap: nowrap; }
th,td { padding: 10px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: #303b51; background: var(--soft); font-size: 12px; font-weight: 690; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbff; }
td small { display: block; overflow-wrap: anywhere; }
td code,.model-id { font: 12px/1.45 "IBM Plex Mono",ui-monospace,monospace; overflow-wrap: anywhere; }
.model-title { font-weight: 675; overflow-wrap: anywhere; }
.price-line { font-variant-numeric: tabular-nums; line-height: 1.4; }
.catalog-source { min-height: 16px; }
.table-footer { font-size: 12px; }
.form-error { color: var(--danger); }
dialog { width: min(95vw,650px); max-height: 90dvh; padding: 20px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--surface); overflow: auto; }
dialog::backdrop { background: #18284865; }
#notice { position: fixed; z-index: 2; bottom: 18px; inset-inline-end: 18px; width: max-content; max-width: min(500px, calc(100% - 36px)); padding: 10px 14px; border-radius: 8px; background: var(--ink); color: white; box-shadow: 0 9px 22px #1e293b22; }
#notice.error { background: var(--danger); }
@media (max-width: 1120px) { body:has(#sidebar:not([hidden])) { grid-template-columns: 175px minmax(0,1fr); } .model-grid { grid-template-columns: minmax(0,1fr); } .model-slot { grid-template-columns: minmax(0,2fr) minmax(90px,1fr); } }
@media (max-width: 680px) { body:has(#sidebar:not([hidden])) { display: block; } .sidebar { position: static; min-height: 0; padding: 12px; gap: 10px; max-height:none; } .sidebar .brand { padding-inline: 0; } .tabs { display: flex; flex-wrap: wrap; gap: 7px 12px; } .nav-group { display:flex; flex-wrap:wrap; gap:3px; } .nav-group > p { display:none; } .tabs button { padding: 5px 8px; min-height: 32px; font-size: 12px; } .sidebar-account { order:-1; grid-template-columns:26px minmax(0,1fr) auto; padding: 0; border:none; } .page-header { min-height: 56px; align-items:flex-start; } .page-content { padding-top: 14px; } .panel { padding: 12px; } }
@media (max-width: 680px) {
  .catalog-table,.license-table { min-width: 0; display: block; }
  .catalog-table thead,.license-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .catalog-table tbody,.license-table tbody { display: block; }
  .catalog-table tr,.license-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 5px 10px; padding: 10px; border-bottom: 1px solid var(--line); }
  .catalog-table tr:last-child,.license-table tr:last-child { border-bottom: 0; }
  .catalog-table td,.license-table td { padding: 0; border: 0; overflow-wrap: anywhere; }
  .catalog-table td:nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; }
  .catalog-table td:nth-child(2) { color: var(--muted); font-size: 12px; }
  .catalog-table td:nth-child(3) { color: var(--ink); font-size: 12px; }
  .catalog-table td[colspan],.license-table td[colspan] { grid-column: 1 / -1; }
  .license-table td:nth-child(2) { justify-self: end; }
  .license-table td:nth-child(3) { grid-column: 1; }
  .license-table td:nth-child(7) { grid-column: 1 / -1; justify-self: end; }
}

.metric-grid {display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}
.metric-card {display:grid;gap:8px;border-top:3px solid #4d63ea}
.metric-card strong {font:700 clamp(22px,3vw,34px)/1.15 system-ui;color:inherit}
.metric-card small {opacity:.78}
.cash-chart {height:200px;display:flex;gap:10px;overflow-x:auto;padding:0 5px;align-items:stretch}
.cash-day {min-width:56px;flex:1;display:grid;gap:6px;grid-template-rows:1fr auto;text-align:center}
.cash-bars {display:flex;justify-content:center;align-items:end;gap:4px;border-bottom:1px solid #8190a84d;background:repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),#8190a824 calc(25% - 1px),#8190a824 25%)}
.cash-bars span {width:min(35%,38px);border-radius:5px 5px 0 0}
.cash-bars .received,.chart-legend i:first-child {background:#5067ec}
.cash-bars .refunded,.chart-legend i:last-child {background:#e39347}
.chart-legend {display:flex;align-items:center;gap:6px;font-size:.82rem}
.chart-legend i {width:10px;height:10px;border-radius:3px;display:inline-block}
.setting-row {display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));align-items:end;gap:10px;padding:10px;border:1px solid #8794b24d;border-radius:10px}
.setting-row label:has(input[type=checkbox]) {align-self:center}
@media(max-width:650px){.cash-chart{height:150px}.setting-row{grid-template-columns:repeat(auto-fit,minmax(95px,1fr))}}

.license-selection { flex-wrap:wrap }
.license-selection [role=status] { min-width:8rem; font-size:.9rem }
.license-check { width:42px; text-align:center }
.license-check input { width:16px; height:16px; margin:0; vertical-align:middle; cursor:pointer }

body:has(#config:not([hidden])) { --brand:#4038c9; --brand-hover:#332bb2; --brand-soft:#edecff; }
body:has(#config:not([hidden])) .sidebar { background:#f2f4fb; }
body:has(#config:not([hidden])) .page-header { border-bottom:0; min-height:72px; }
body:has(#config:not([hidden])) h1 { font-size:clamp(21px,2.3vw,28px); }
#config { gap:20px; }
.model-pricing-strip { display:flex; align-items:center; flex-wrap:wrap; gap:10px 16px; padding:14px 18px; background:#e8e7ff; color:#272174; border:1px solid #dcd9fb; border-radius:11px; }
.model-pricing-strip strong { font-size:18px; }
.pricing-rule { border-inline-start:1px solid #aaa6ee; padding-inline-start:14px; }
.pricing-conversion { padding:3px 8px; border:1px solid #aaa6ee; border-radius:6px; background:#f7f6ff; font-weight:680; white-space:nowrap; }
#config .model-grid { grid-template-columns:minmax(0,1.9fr) minmax(300px,1fr); gap:15px; }
#config .provider-tabs { gap:0; width:max-content; max-width:100%; }
#config .provider-tabs button { border-radius:0; padding-inline:13px; }
#config .provider-tabs button:first-child { border-radius:7px 0 0 7px; }
#config .provider-tabs button:last-child { border-radius:0 7px 7px 0; }
#config .provider-tabs button[aria-pressed=true] { color:white; background:var(--brand); border-color:var(--brand); }
#config .catalog-toolbar .search { flex-basis:180px; }
#config .catalog-table { min-width:0; }
#config .catalog-table th,#config .catalog-table td { padding:9px 8px; }
#config .catalog-table td:last-child { width:1%; }
#config .catalog-table td:last-child .actions { gap:5px; }
#config .catalog-table td:last-child button { padding-inline:8px; }
#config .catalog-source { border-top:1px solid var(--line); padding-top:9px; }
#config .model-slot { grid-template-columns:minmax(0,1fr); }
.offer-list { border-block:1px solid var(--line); }
.offer-list > p { padding:12px 0; }
.offer-list-row { min-width:0; display:grid; grid-template-columns:23px minmax(0,1fr) auto auto; gap:8px; align-items:center; padding:12px 0; border-bottom:1px solid var(--line); }
.offer-list-row:last-child { border-bottom:0; }
.offer-list-row .film-icon { margin-inline:0; color:#303759; border-color:#303759; }
.offer-information { min-width:0; overflow-wrap:anywhere; display:grid; gap:3px; }
.offer-information strong { line-height:1.25; }
.offer-information small { color:var(--muted); }
.default-model-control { display:grid; align-items:center; grid-template-columns:auto minmax(0,1fr); gap:8px; font-size:12px; }
.model-sidebar summary { font-size:15px; color:var(--ink); }
.price-preview-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr)); align-items:stretch; gap:10px; border-top:1px solid var(--line); padding-top:11px; }
.price-preview-cell { display:grid; align-content:center; gap:4px; padding:8px 10px; min-width:0; overflow-wrap:anywhere; }
.price-preview-cell strong { font-size:15px; }
.price-preview-cell:last-child { color:var(--brand-hover); background:var(--brand-soft); border-radius:8px; }
.offer-choices { margin:0; padding:7px 0 0; border:0; display:flex; flex-wrap:wrap; gap:6px; }
.offer-choices legend { font-size:13px; font-weight:650; }
.offer-choice { display:flex; align-items:center; gap:4px; padding:3px 7px; min-height:32px; border:1px solid var(--line); border-radius:6px; }
.offer-choice:has(input:checked) { border-color:#ada6ed; background:#f2f0ff; color:#2c247d; }
.offer-choice input { width:14px; min-height:14px; margin:0; accent-color:#4038c9; }
#offer-model-id { overflow-wrap:anywhere; }
@media (max-width:1100px) { #config .model-grid { grid-template-columns:minmax(0,1fr); } }
@media (max-width:680px) {
  .model-pricing-strip { padding:11px; gap:5px 10px; }
  .pricing-rule { border:0; padding:0; }
  #config .catalog-table td { padding:4px 0; }
  #config .catalog-table td:nth-child(4) { grid-column:2; grid-row:1; }
  #config .catalog-table td:nth-child(5) { grid-column:2; justify-self:end; width:auto; }
  #config .catalog-table td:nth-child(5) .actions { flex-wrap:wrap; }
}

#config h2 { font-size:19px; }
#config .model-title,.offer-information strong { font-size:14px; }
#config .catalog-table th { font-size:12.5px; }
#config .catalog-table tr[data-selected=true] td { background:#f0efff; }
.price-preview-cell:last-child strong { font-size:18px; }

.verify-matrix { max-height: 300px; overflow: auto; border: 1px solid var(--line, #dee7ee); border-radius: 8px; }
.verify-matrix table { min-width: 540px; }
.verify-matrix th { position: sticky; top: 0; z-index: 1; }
.matrix-state { display: inline-block; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.matrix-state.available { color: #16644c; background: #dff3e9; }
.matrix-state.blocked { color: #855419; background: #fff0db; }

.attention-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(145px,1fr)); gap:9px; }
.attention-card { text-align:left; display:grid; gap:4px; padding:10px 12px; align-items:start; }
.attention-card strong { font-size:22px; font-variant-numeric:tabular-nums; }
.attention-card small { color:var(--muted,#596980); }
