:root {
  color-scheme: light;
  font-family: "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #17202a;
  background: #f4f6f8;
  --ink: #17202a;
  --muted: #5f6b76;
  --line: #d9dee5;
  --soft: #eef1f4;
  --surface: #ffffff;
  --green: #136c5b;
  --green-dark: #0d5246;
  --green-soft: #e5f3ef;
  --accent: #136c5b;
  --accent-dark: #0d5246;
  --accent-soft: #e5f3ef;
  --accent-ring: rgba(19, 108, 91, 0.12);
  --amber: #a55c00;
  --amber-soft: #fff1d7;
  --red: #b3261e;
  --red-soft: #fce8e6;
  --blue: #275ea8;
  --blue-soft: #e8f0fb;
  --shadow: 0 10px 30px rgba(20, 29, 38, 0.12);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f4f6f8; }
body[data-environment="test"] {
  --accent: #a65308;
  --accent-dark: #824005;
  --accent-soft: #fff4e5;
  --accent-ring: rgba(166, 83, 8, 0.14);
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
[hidden] { display: none !important; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #edf3f1 0%, #f7f7f5 52%, #edf0f4 100%); }
.login-panel { width: min(100%, 390px); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 36px; box-shadow: var(--shadow); }
.login-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; color: #fff; background: var(--accent); border-radius: 8px; font-size: 22px; font-weight: 700; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 6px; font-size: 18px; flex: 0 0 auto; }
.eyebrow { margin: 18px 0 4px; color: var(--accent); font-size: 12px; font-weight: 700; }
.login-panel h1 { margin: 0; font-size: 26px; letter-spacing: 0; }
.environment-note { margin: 8px 0 24px; padding: 9px 11px; color: var(--muted); background: var(--soft); border-left: 3px solid #8d98a3; font-size: 12px; }
body[data-environment="production"] .environment-note { color: #0b5b49; background: var(--green-soft); border-left-color: var(--green); }
body[data-environment="test"] .environment-note { color: #7b3e07; background: var(--amber-soft); border-left-color: var(--amber); }

.form-stack, .form-grid { display: grid; gap: 16px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full-row { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: #36414b; font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid #bfc7d1; border-radius: 5px; color: var(--ink); background: #fff; outline: none; transition: border-color 160ms, box-shadow 160ms; }
textarea { min-height: 84px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid #2b78c5; outline-offset: 2px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.field-hint { margin: -2px 0 0; color: var(--muted); font-size: 12px; font-weight: 400; }
.form-error { min-height: 21px; margin: 0; color: var(--red); }

.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 8px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff; font-weight: 650; transition: background-color 160ms, border-color 160ms, color 160ms; }
.button:hover { background: #f4f6f8; border-color: #aab3bd; }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button.danger { color: var(--red); border-color: #e2aaa6; }
.button.danger:hover { background: var(--red-soft); }
.button.full { width: 100%; }
.button svg, .icon-button svg, .nav-item svg { width: 18px; height: 18px; stroke-width: 2; }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 5px; color: #42505e; background: #fff; transition: background-color 160ms, color 160ms; }
.icon-button:hover { color: var(--accent); background: var(--accent-soft); }

.app-shell { min-height: 100vh; }
.app-header { position: sticky; z-index: 30; top: 0; background: rgba(255, 255, 255, 0.98); border-bottom: 1px solid var(--line); }
.header-row { width: min(100%, 1520px); min-height: 64px; display: grid; grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr); align-items: center; gap: 16px; margin: 0 auto; padding: 9px 24px; }
.brand { display: flex; min-width: 0; align-items: center; justify-self: start; gap: 10px; }
.brand strong, .brand span { display: block; letter-spacing: 0; }
.brand strong { font-size: 14px; }
.brand span { color: var(--muted); font-size: 11px; }
.main-nav { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 2px; }
.nav-item { display: inline-flex; min-width: max-content; height: 38px; align-items: center; gap: 7px; padding: 0 12px; border: 0; border-radius: 5px; color: #52606d; background: transparent; font-weight: 600; transition: background-color 160ms, color 160ms; }
.nav-item:hover { color: var(--ink); background: #eef1f4; }
.nav-item.active { color: var(--accent-dark); background: var(--accent-soft); }
.header-actions { display: flex; align-items: center; justify-self: end; gap: 7px; }
.workspace { min-width: 0; }
.page-heading { width: min(100%, 1520px); display: flex; align-items: flex-end; justify-content: space-between; margin: 0 auto; padding: 18px 24px 0; }
.page-heading h1 { margin: 0; font-size: 20px; }
.page-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.content { width: min(100%, 1520px); margin: 0 auto; padding: 14px 24px 28px; outline: none; }

.section-header, .toolbar, .action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-header { margin-bottom: 16px; }
.section-header h2 { margin: 0; font-size: 17px; }
.section-header p { margin: 2px 0 0; color: var(--muted); }
.toolbar { min-height: 54px; margin-bottom: 10px; padding: 8px 10px; align-items: center; flex-wrap: wrap; background: #eef1f4; border: 1px solid #dde2e7; border-radius: 6px; }
.toolbar .search { width: min(100%, 460px); }
.toolbar .search.form-grid { width: min(100%, 620px); display: flex; align-items: center; gap: 10px; }
.toolbar .search.form-grid label:first-child { flex: 1 1 340px; }
.toolbar label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.toolbar label > input, .toolbar label > select { min-height: 36px; }
.toolbar label > select { width: auto; min-width: 104px; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.dashboard-summary { display: grid; grid-template-columns: minmax(360px, 3fr) minmax(480px, 4fr); gap: 10px; margin-bottom: 22px; }
.metric-group { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.metric-group-heading { padding: 7px 14px; color: var(--muted); background: #f5f7f9; border-bottom: 1px solid #e5e9ee; font-size: 11px; font-weight: 700; }
.metric-grid { display: grid; }
.core-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.attention-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { min-width: 0; min-height: 66px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-right: 1px solid #e5e9ee; }
.metric:last-child { border-right: 0; }
.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: var(--accent); background: var(--accent-soft); border-radius: 6px; }
.metric-icon svg { width: 18px; height: 18px; stroke-width: 2; }
.metric-copy { min-width: 0; display: flex; flex-direction: column; }
.metric strong { color: var(--ink); font-size: 22px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.metric span { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.metric.attention .metric-icon { color: #86500b; background: var(--amber-soft); }
.metric.attention strong { color: #744509; }
.metric.danger .metric-icon { color: var(--red); background: var(--red-soft); }
.metric.danger strong { color: #97231d; }

.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 9px 12px; border-bottom: 1px solid #e5e9ee; text-align: left; vertical-align: middle; white-space: nowrap; }
td { font-size: 13px; }
th { position: sticky; top: 0; color: #4b5864; background: #f5f7f9; font-size: 12px; font-weight: 700; white-space: nowrap; }
tbody tr { transition: background-color 140ms; }
tbody tr:hover { background: #f6faf8; }
tbody tr.clickable { cursor: pointer; }
tbody tr:last-child td { border-bottom: 0; }
.mono { font-family: Consolas, "Microsoft YaHei UI", monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.customer-cell { display: flex; min-width: 0; align-items: baseline; gap: 7px; }
.customer-cell strong { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-cell .customer-number { color: var(--muted); font-size: 11px; }
.inline-detail, .money-pair { display: inline-flex; align-items: baseline; gap: 8px; }
.inline-detail span + span, .money-pair span { color: var(--muted); font-size: 12px; }
.money-pair strong { color: var(--ink); font-size: 13px; }
.cell-primary { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; }
.cell-wrap { min-width: 160px; max-width: 340px; white-space: normal; overflow-wrap: anywhere; }
.empty { padding: 48px 20px; color: var(--muted); text-align: center; }
.empty svg { width: 30px; height: 30px; margin-bottom: 8px; }

.release-environment { display: grid; grid-template-columns: 42px auto minmax(220px, 1fr); align-items: center; gap: 12px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid; border-radius: 7px; }
.release-environment.production { color: #0b5b49; background: var(--green-soft); border-color: #b7d8cf; }
.release-environment.test { color: #774100; background: var(--amber-soft); border-color: #eccb94; }
.release-environment > svg { width: 24px; height: 24px; justify-self: center; }
.release-environment > div { display: grid; }
.release-environment span { font-size: 11px; font-weight: 700; }
.release-environment strong { font-size: 16px; }
.release-environment p { justify-self: end; margin: 0; color: currentColor; font-size: 12px; }
.release-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr); gap: 12px; }
.release-panel { min-width: 0; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.release-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.release-panel-heading .eyebrow { margin: 0 0 2px; }
.release-panel-heading h2 { margin: 0; font-size: 17px; }
.release-form { display: grid; gap: 12px; }
.release-form > .form-grid { gap: 12px; }
.file-info { min-height: 18px; margin: -7px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.release-submit { justify-self: start; min-width: 160px; }
.release-progress { display: grid; gap: 6px; padding: 10px 12px; background: #f5f7f9; border: 1px solid var(--line); border-radius: 6px; }
.release-progress > div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.release-progress strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.release-progress progress { width: 100%; height: 10px; overflow: hidden; border: 0; border-radius: 3px; background: #dfe5e9; accent-color: var(--accent); }
.release-progress progress::-webkit-progress-bar { background: #dfe5e9; }
.release-progress progress::-webkit-progress-value { background: var(--accent); }
.release-progress progress::-moz-progress-bar { background: var(--accent); }
.current-version { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.current-version strong { font-size: 23px; color: var(--accent-dark); }
.current-version span { min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.release-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.release-facts div { padding: 10px; background: #f5f7f9; border-radius: 5px; }
.release-facts dt { color: var(--muted); font-size: 11px; }
.release-facts dd { margin: 3px 0 0; font-weight: 650; }
.release-notes { margin: 8px 0 0; padding-left: 20px; color: #36414b; }
.release-notes li { margin: 3px 0; white-space: normal; overflow-wrap: anywhere; }
.release-current-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.release-history { margin-top: 22px; }
.release-table table { min-width: 940px; }
.release-title-cell { min-width: 280px; max-width: 480px; white-space: normal; }
.release-title-cell > strong { display: block; }
.release-title-cell .release-notes { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.status-pill { display: inline-flex; min-height: 24px; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-pill.good { color: #0b5b49; background: var(--green-soft); }
.status-pill.warn { color: #774100; background: var(--amber-soft); }
.status-pill.bad { color: #902019; background: var(--red-soft); }
.status-pill.info { color: #214f8b; background: var(--blue-soft); }
.status-pill.neutral { color: #4e5964; background: #edf0f3; }

.detail-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.detail-item { min-height: 72px; padding: 12px; background: var(--surface); }
.detail-item span { display: block; color: var(--muted); font-size: 12px; }
.detail-item strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.subsection { margin-top: 24px; }
.subsection h3 { margin: 0 0 10px; font-size: 15px; }
.action-row { justify-content: flex-start; flex-wrap: wrap; padding: 14px 0 4px; }
.check-label { display: flex !important; flex-direction: row !important; align-items: center; gap: 9px; }
.check-label input { width: 18px; height: 18px; margin: 0; }

.modal.license-detail-modal { width: min(100%, 1040px); }
.license-detail-modal .modal-body { padding: 0; }
.license-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 248px; min-height: 560px; }
.license-main { min-width: 0; padding: 22px 24px 26px; }
.license-summary { margin-bottom: 24px; }
.license-summary-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.license-summary-heading > div { display: grid; gap: 2px; }
.license-summary-heading strong { font-size: 18px; }
.summary-label { color: var(--muted); font-size: 12px; }
.detail-band.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.detail-band.compact .detail-item { min-height: 68px; }
.price-summary { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 10px 12px; color: var(--muted); border: 1px solid var(--line); border-top: 0; font-size: 12px; }
.price-summary strong { margin-left: 4px; color: var(--ink); font-size: 13px; }
.license-actions { padding: 22px 18px; background: #f7f8fa; border-left: 1px solid var(--line); }
.license-actions h3 { margin: 0 0 16px; font-size: 15px; }
.action-group { display: grid; gap: 8px; margin-top: 18px; }
.action-group:first-of-type { margin-top: 0; }
.action-group > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.action-group .button { width: 100%; justify-content: flex-start; background: var(--surface); }
.action-group .button.primary { background: var(--accent); }
.action-group .button.danger { background: var(--surface); }
.risk-group { padding-top: 18px; border-top: 1px solid var(--line); }
.action-note { margin: 0; color: var(--muted); }
.license-records { min-width: 0; }
.record-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.record-tab { position: relative; display: inline-flex; min-width: max-content; min-height: 42px; align-items: center; gap: 7px; padding: 8px 12px; border: 0; color: var(--muted); background: transparent; font-weight: 650; }
.record-tab::after { position: absolute; right: 10px; bottom: -1px; left: 10px; height: 2px; content: ""; background: transparent; }
.record-tab:hover { color: var(--ink); background: #f7f8fa; }
.record-tab.active { color: var(--accent-dark); }
.record-tab.active::after { background: var(--accent); }
.record-count { min-width: 22px; padding: 1px 6px; color: #53606c; background: #edf0f3; border-radius: 999px; font-size: 11px; text-align: center; }
.record-panel { padding-top: 14px; }
.license-detail-modal .record-panel table { min-width: 600px; }
.license-detail-modal .record-panel .empty { padding: 52px 20px; border: 1px solid var(--line); border-radius: 7px; }
.modal.customer-detail-modal { width: min(100%, 960px); }
.customer-detail-modal .modal-body { padding: 0; }
.customer-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 220px; min-height: 500px; }
.customer-main { min-width: 0; padding: 22px 24px 26px; }
.customer-summary { margin-bottom: 24px; }
.customer-summary-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.customer-summary-heading > div { display: grid; gap: 2px; }
.customer-summary-heading strong { font-size: 16px; }
.customer-notes { margin-top: 12px; padding: 10px 12px; color: var(--muted); background: #f7f8fa; border: 1px solid var(--line); border-radius: 6px; }
.customer-notes span { font-size: 12px; font-weight: 700; }
.customer-notes p { margin: 4px 0 0; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.customer-actions { padding: 22px 18px; background: #f7f8fa; border-left: 1px solid var(--line); }
.customer-actions h3 { margin: 0 0 16px; font-size: 15px; }
.customer-actions .button { width: 100%; justify-content: flex-start; }
.customer-actions .button + .button { margin-top: 8px; }
.customer-actions .action-note { margin-top: 10px; font-size: 12px; }
.customer-detail-modal .record-panel table { min-width: 560px; }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(17, 24, 28, 0.48); }
.modal { width: min(100%, 680px); max-height: calc(100vh - 36px); overflow: auto; background: var(--surface); border: 1px solid #c7cdd4; border-radius: 8px; box-shadow: 0 24px 70px rgba(8, 14, 18, 0.28); }
.modal-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.modal-header .eyebrow { margin: 0 0 2px; }
.modal-header h2 { margin: 0; font-size: 19px; }
.modal-body { padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.confirmation { padding: 12px; color: #5f3900; background: var(--amber-soft); border-left: 3px solid var(--amber); }
.code-output { display: grid; gap: 12px; }
.code-value { padding: 14px; overflow-wrap: anywhere; color: #0e493e; background: var(--green-soft); border: 1px solid #b7d8cf; border-radius: 5px; font-family: Consolas, monospace; font-size: 16px; }

.toast-region { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; color: #fff; background: #26332f; border-radius: 6px; box-shadow: var(--shadow); animation: toast-in 180ms ease-out; }
.toast.error { background: #92271f; }
.toast svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.loading { display: grid; place-items: center; min-height: 280px; color: var(--muted); }
.spinner { width: 24px; height: 24px; margin-bottom: 10px; border: 3px solid #dce5e2; border-top-color: var(--accent); border-radius: 50%; animation: spin 800ms linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1180px) {
  .header-row { grid-template-columns: minmax(58px, 1fr) auto minmax(138px, 1fr); gap: 12px; }
  .brand span { display: none; }
  .nav-item { padding: 0 9px; }
  .dashboard-summary { grid-template-columns: 1fr; }
  .detail-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-layout { grid-template-columns: minmax(0, 1fr) minmax(310px, 0.8fr); }
}

@media (max-width: 760px) {
  .header-row { min-height: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px 0; }
  .brand { flex: 1 1 auto; }
  .main-nav { order: 3; width: calc(100% + 24px); flex: 1 0 calc(100% + 24px); gap: 0; margin: 0 -12px; padding: 0 8px; overflow-x: auto; border-top: 1px solid var(--line); }
  .nav-item { height: 42px; border-radius: 0; }
  .nav-item.active { box-shadow: inset 0 -2px 0 var(--accent); }
  .nav-item svg { display: none; }
  .header-actions .status-pill { max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
  .page-heading { padding: 14px 12px 0; }
  .content { padding: 16px 12px; }
  .toolbar { align-items: stretch; }
  .toolbar .search, .toolbar .search.form-grid { width: 100%; display: grid; grid-template-columns: 1fr; }
  .toolbar label { align-items: stretch; flex-direction: column; }
  .toolbar label > select { width: 100%; }
  .toolbar-actions, .toolbar > .button { margin-left: auto; }
  .metric-group-heading { padding-inline: 12px; }
  .core-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .attention-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding-inline: 12px; }
  .attention-metrics .metric:nth-child(2) { border-right: 0; }
  .attention-metrics .metric:nth-child(-n + 2) { border-bottom: 1px solid #e5e9ee; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-band { grid-template-columns: 1fr 1fr; }
  .release-environment { grid-template-columns: 36px 1fr; }
  .release-environment p { grid-column: 2; justify-self: start; }
  .release-layout { grid-template-columns: 1fr; }
  .release-panel { padding: 16px; }
  .release-submit { width: 100%; }
  .release-current-actions .button { flex: 1 1 160px; }
  .login-panel { padding: 28px 22px; }
  .modal-backdrop { padding: 8px; }
  .modal { max-height: calc(100vh - 16px); }
  .modal-header, .modal-body { padding: 16px; }
  .license-detail-modal .modal-body { padding: 0; }
  .license-workspace { grid-template-columns: 1fr; }
  .license-main { padding: 18px 16px 20px; }
  .license-actions { padding: 18px 16px 22px; border-top: 1px solid var(--line); border-left: 0; }
  .license-actions h3 { margin-bottom: 12px; }
  .record-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; overflow: visible; }
  .record-tab { min-width: 0; justify-content: center; gap: 4px; padding: 8px 4px; font-size: 12px; }
  .action-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-group > span { grid-column: 1 / -1; }
  .action-group .button { min-width: 0; }
  .customer-detail-modal .modal-body { padding: 0; }
  .customer-workspace { grid-template-columns: 1fr; }
  .customer-main { padding: 18px 16px 20px; }
  .customer-actions { padding: 18px 16px 22px; border-top: 1px solid var(--line); border-left: 0; }
  .customer-detail-modal [data-panel="licenses"] table { min-width: 0; table-layout: fixed; }
  .customer-detail-modal [data-panel="licenses"] th:nth-child(4), .customer-detail-modal [data-panel="licenses"] td:nth-child(4),
  .customer-detail-modal [data-panel="licenses"] th:nth-child(5), .customer-detail-modal [data-panel="licenses"] td:nth-child(5) { display: none; }
  .customer-detail-modal [data-panel="licenses"] td:first-child { white-space: normal; overflow-wrap: anywhere; }
}

@media (max-width: 390px) {
  .detail-band { grid-template-columns: 1fr; }
  .detail-band.compact { grid-template-columns: 1fr; }
  .action-group { grid-template-columns: 1fr; }
  .core-metrics { grid-template-columns: 1fr; }
  .core-metrics .metric { border-right: 0; border-bottom: 1px solid #e5e9ee; }
  .core-metrics .metric:last-child { border-bottom: 0; }
  .metric strong { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
