:root {
  color-scheme: light;
  --navy: #111c33;
  --navy-soft: #1a2946;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e9f1;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --green: #087a55;
  --green-soft: #e9f8f1;
  --amber: #a15c00;
  --amber-soft: #fff5db;
  --red: #b42318;
  --red-soft: #fff0ee;
  --radius: 12px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
.restored-admin-view .operation-result {
  position: fixed; right: 24px; bottom: 24px; z-index: 100;
  max-width: min(560px, calc(100vw - 48px)); max-height: 35vh;
  overflow: auto; margin: 0; box-shadow: 0 8px 30px #11182726;
}
a { color: var(--blue); text-decoration: none; }
button, input, select { font: inherit; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 28px; letter-spacing: -.03em; }
h2 { margin-bottom: 5px; font-size: 17px; }
code { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; color: #d7e0ef; background: var(--navy); display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; padding: 2px 8px 24px; color: white; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: .01em; }
.brand small { margin-top: 2px; color: #95a5c0; font-size: 12px; }
.brand-mark { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: white; background: linear-gradient(140deg, #4f8cff, #3154d7); font-size: 25px; font-weight: 750; box-shadow: 0 10px 30px #15377466; }
.brand-mark.small { width: 37px; height: 37px; border-radius: 10px; font-size: 18px; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { padding: 11px 13px; border-radius: 8px; color: #aebbd0; font-weight: 560; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: var(--navy-soft); }
.sidebar nav a.active { box-shadow: inset 3px 0 #4f8cff; }
.sidebar-footer { margin-top: auto; padding: 16px 9px 0; border-top: 1px solid #ffffff17; color: #9dacbf; font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #31c48d; box-shadow: 0 0 0 4px #31c48d20; }
.link-button { margin-top: 10px; padding: 0; border: 0; background: transparent; color: #9eb9ff; cursor: pointer; }
.main-content { min-width: 0; padding: 30px 34px 56px; }
.topbar { margin-bottom: 25px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.topbar p { margin-bottom: 0; }
.admin-chip { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 7px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--muted); font-size: 13px; }
.admin-chip span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.eyebrow { margin-bottom: 6px !important; color: var(--blue); font-size: 11px; font-weight: 750; letter-spacing: .16em; }
.muted { color: var(--muted); }

.panel { margin-bottom: 20px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 4px #11182708; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel > .panel-heading { padding: 20px 20px 0; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 16px; background: #f8fafc; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #667085; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-align: left; white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid #edf0f5; vertical-align: top; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { margin-top: 5px; color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card { position: relative; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; color: var(--ink); box-shadow: 0 2px 4px #11182708; }
.stat-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 12px 0 0 12px; background: #70a0ff; }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card strong { display: block; margin: 8px 0 5px; font-size: 30px; }
.stat-card small { font-size: 12px; }
.stat-card.warning::before { background: #f59e0b; }
.stat-card.danger::before { background: #ef4444; }
.workflow { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 20px; color: var(--muted); }
.workflow div { display: grid; grid-template-columns: 34px auto; column-gap: 10px; align-items: center; }
.workflow div span { grid-row: span 2; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 750; }
.workflow div strong { color: var(--ink); font-size: 13px; }
.workflow div small { font-size: 11px; }
.workflow i { width: 35px; height: 1px; background: #cdd5df; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs a { padding: 8px 14px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.tabs a.active { background: white; color: var(--blue); box-shadow: 0 1px 4px #10182812; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #eef2f6; color: #475467; font-size: 11px; font-weight: 650; white-space: nowrap; }
.type-formal, .status-approved, .status-active { background: var(--green-soft); color: var(--green); }
.type-trial, .status-pending, .status-suspended { background: var(--amber-soft); color: var(--amber); }
.type-development { background: var(--blue-soft); color: var(--blue); }
.status-rejected, .status-revoked { background: var(--red-soft); color: var(--red); }
.check { color: var(--green) !important; font-weight: 600; }
.text-danger { color: var(--red) !important; }
.compact { margin: 0 0 6px; font-size: 12px; }
.actions-cell { min-width: 205px; }
.compact-form { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.compact-form input, .compact-form select { min-width: 0; max-width: 165px; padding: 7px 8px; }
.device-actions { min-width: 360px; }
.device-actions .compact-form { align-items: stretch; }
.device-actions .delete-form { padding-top: 7px; border-top: 1px solid var(--line); }
.reject-form { margin-top: 7px; }

label { display: grid; gap: 6px; color: #344054; font-size: 12px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #ccd4df; border-radius: 7px; background: white; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: #6c94ee; box-shadow: 0 0 0 3px #2563eb18; }
.check-row { display: flex; align-items: center; gap: 9px; }
.check-row input { width: auto; min-height: 0; }
label small { color: var(--muted); font-weight: 400; }
.form-stack { display: grid; gap: 15px; }
.form-row { display: flex; align-items: end; gap: 10px; }
.form-row label { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-actions { grid-column: 1 / -1; }
.button { display: inline-flex; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 7px; align-items: center; justify-content: center; cursor: pointer; font-weight: 650; white-space: nowrap; }
.button.primary { background: var(--blue); color: white; box-shadow: 0 1px 2px #1d4ed866; }
.button.primary:hover { background: #1d4ed8; }
.button.secondary { border-color: #ccd4df; background: white; color: #344054; }
.button.danger-outline { border-color: #f1b6b0; background: white; color: var(--red); }
.button.danger { border-color: var(--red); background: var(--red); color: white; }
.button.small { min-height: 31px; padding: 5px 9px; font-size: 12px; }
.button.wide { width: 100%; }
.split-grid, .detail-grid { display: grid; grid-template-columns: 1fr 1.7fr; gap: 20px; }
.detail-grid { grid-template-columns: 1fr 1fr; }
.empty-inline { padding: 15px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); }
.search-form { display: flex; gap: 7px; width: min(420px, 100%); }
.empty-state { padding: 55px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: #344054; font-size: 15px; }
.empty-state p { margin: 8px 0 0; }
.flash { margin-bottom: 18px; padding: 11px 14px; border: 1px solid #a9dfca; border-radius: 8px; background: var(--green-soft); color: var(--green); }
.flash.error { border-color: #f1b6b0; background: var(--red-soft); color: var(--red); }
details summary { color: var(--blue); cursor: pointer; }
details pre { max-width: 420px; overflow: auto; padding: 10px; border-radius: 6px; background: #f5f7fa; white-space: pre-wrap; font-size: 11px; }
.status-banner { display: flex; gap: 13px; align-items: center; margin-bottom: 20px; padding: 18px; border: 1px solid #a9dfca; border-radius: var(--radius); background: var(--green-soft); color: var(--green); }
.status-banner > span { width: 12px; height: 12px; border-radius: 50%; background: #12a474; box-shadow: 0 0 0 5px #12a47420; }
.status-banner p { margin: 4px 0 0; }
.status-banner.unhealthy { border-color: #f1b6b0; background: var(--red-soft); color: var(--red); }
.status-banner.unhealthy > span { background: var(--red); }
dl { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 11px 12px; margin-bottom: 0; }
dt { color: var(--muted); font-size: 12px; }
dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.notice { margin-top: 18px; padding: 12px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); font-size: 12px; }
.notice p { margin: 4px 0 0; }
.internal-tools p { color: var(--muted); }
.target-fieldset { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.target-fieldset legend { padding: 0 6px; color: #344054; font-size: 12px; font-weight: 700; }
.device-picker { max-height: 260px; margin-top: 10px; overflow-y: auto; border-top: 1px solid var(--line); }
.device-choice { grid-template-columns: auto 1fr; align-items: center; padding: 9px 2px; border-bottom: 1px solid #edf0f5; }
.device-choice input { width: auto; min-height: 0; }
.device-choice strong, .device-choice small { display: block; }
.device-choice small { margin-top: 3px; color: var(--muted); font-weight: 400; }

.license-tree-summary { display: flex; gap: 8px; align-items: center; margin: 4px 0 14px; color: var(--muted); font-size: 13px; }
.license-tree { display: grid; gap: 16px; }
.customer-node, .device-node { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.customer-node > summary, .device-node > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px 18px; cursor: pointer; list-style: none; }
.customer-node > summary::-webkit-details-marker, .device-node > summary::-webkit-details-marker { display: none; }
.customer-node > summary::after, .device-node > summary::after { content: "⌄"; grid-column: 4; color: var(--muted); font-size: 18px; }
.customer-node:not([open]) > summary::after, .device-node:not([open]) > summary::after { content: "›"; }
.customer-node summary strong, .customer-node summary small, .device-node summary strong, .device-node summary small { display: block; }
.customer-node summary small, .device-node summary small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.tree-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; font-weight: 750; font-size: 12px; }
.customer-icon { background: var(--blue-soft); color: var(--blue); }
.device-icon { background: var(--green-soft); color: var(--green); }
.software-icon { background: #f3edff; color: #6941c6; }
.customer-body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.customer-policy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; padding: 16px 0; }
.policy-card { padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fafcff; }
.policy-card > div:first-child strong, .policy-card > div:first-child small { display: block; }
.policy-card > div:first-child small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.compact-dl { grid-template-columns: 72px minmax(0, 1fr); gap: 7px; margin: 12px 0; }
.policy-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.policy-actions form { margin: 0; }
.policy-actions input { width: 130px; }
.device-tree-list { display: grid; gap: 12px; }
.device-node { margin-left: 22px; border-left: 3px solid #9ddbc8; }
.device-body { padding: 0 16px 16px; border-top: 1px solid var(--line); }
.presence { font-size: 12px; font-weight: 700; }
.presence.online { color: var(--green); }
.presence.offline { color: var(--muted); }
.device-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 14px 0; }
.device-facts span { padding: 10px; border-radius: 7px; background: #f7f9fc; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.device-facts b { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.device-metadata-form { display: grid; grid-template-columns: 1fr 2fr auto; gap: 9px; align-items: end; margin-bottom: 12px; }
.device-control-row { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 14px; }
.device-control-row form { margin: 0; }
.software-branch { padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.branch-title { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.branch-title small { color: var(--muted); }
.software-node { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.software-form { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; }
.software-form label { font-size: 10px; }
.software-form input, .software-form select { min-height: 34px; padding: 6px 8px; font-size: 12px; }
.software-identity { min-height: 52px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: white; display: flex; flex-direction: column; justify-content: center; }
.software-identity small { color: var(--muted); font-size: 10px; }
.software-identity strong { margin: 2px 0; font-size: 13px; }
.software-identity code { color: var(--blue); font: 11px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.software-state { display: flex; align-items: end; justify-content: space-between; gap: 8px; grid-column: 1 / -1; }
.software-delete { padding-top: 18px; }
.add-software { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #cfd7e3; }
.add-software > summary { color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 700; }
.new-software { margin-top: 12px; }
.product-choice small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.all-software-configured { margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed #cfd7e3; color: var(--muted); font-size: 12px; }
.delete-customer { margin-top: 18px; color: var(--red); }
.delete-customer > summary { cursor: pointer; font-size: 12px; }
.delete-customer form { margin-top: 10px; }
.status-expired { background: var(--red-soft); color: var(--red); }
.status-not-yet-valid { background: var(--blue-soft); color: var(--blue); }

.identity-create-panel { border-top: 3px solid #5b82ee; }
.identity-list { display: grid; gap: 14px; }
.identity-list-heading { display: flex; align-items: end; justify-content: space-between; padding: 2px 2px 0; }
.identity-list-heading h2 { margin-bottom: 3px; font-size: 19px; }
.identity-list-heading p { margin-bottom: 0; font-size: 13px; }
.user-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 5px #1118270a; }
.user-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 16px 18px; color: var(--ink); cursor: pointer; list-style: none; }
.user-summary::-webkit-details-marker { display: none; }
.user-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg, #eaf1ff, #dbe8ff); color: var(--blue); font-weight: 800; }
.user-title { min-width: 0; }
.user-title strong, .user-title small { display: block; }
.user-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.user-title small { margin-top: 3px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.user-chevron::before { content: "⌃"; color: var(--muted); font-size: 17px; }
.user-card:not([open]) .user-chevron::before { content: "⌄"; }
.user-body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.user-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 15px 0; }
.user-facts > span { min-width: 0; padding: 10px 11px; border-radius: 8px; background: #f7f9fc; overflow-wrap: anywhere; font-size: 12px; }
.user-facts b { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 650; }
.user-section { padding: 15px 0; border-top: 1px solid #edf0f5; }
.section-heading { margin-bottom: 12px; }
.section-heading h3 { margin: 0 0 4px; font-size: 14px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.account-actions-grid, .relation-grid, .quota-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.action-card, .relation-card, .quota-card { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.relation-grid { padding-top: 1px; }
.relation-card { margin-top: 0; border-top: 1px solid var(--line); }
.tag-list { min-height: 48px; display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; align-content: flex-start; }
.tag { min-width: 150px; padding: 7px 9px; border: 1px solid #dce3ed; border-radius: 8px; background: white; }
.tag strong, .tag small { display: block; }
.tag strong { color: #344054; overflow-wrap: anywhere; font-size: 11px; }
.tag small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.empty-compact { color: var(--muted); font-size: 12px; }
.relation-form { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(120px, .7fr); gap: 8px; align-items: end; }
.relation-form .button { grid-column: 1 / -1; }
.assignment-tree { display: grid; gap: 12px; }
.assignment-customer { overflow: hidden; border: 1px solid #dce3ed; border-radius: 10px; background: #fbfcfe; }
.assignment-customer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #e8edf3; background: white; }
.assignment-customer-heading strong, .assignment-customer-heading small { display: block; }
.assignment-customer-heading small, .assignment-device-name small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.assignment-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 11px 14px; border-bottom: 1px solid #edf0f5; }
.inline-edit-form { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)) auto; gap: 8px; align-items: end; }
.inline-remove-form { display: flex; align-items: end; }
.assignment-devices { display: grid; gap: 8px; padding: 12px 14px 14px 30px; }
.assignment-subtitle { color: #475467; font-size: 11px; }
.assignment-device-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, .9fr) auto; gap: 8px; align-items: end; padding: 9px 10px; border-left: 3px solid #b7c9df; border-radius: 7px; background: white; }
.assignment-device-name strong { display: block; color: #344054; font-size: 12px; }
.device-edit-form { display: grid; grid-template-columns: minmax(100px, 1fr) auto; gap: 8px; align-items: end; }
.device-add-form, .customer-add-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(130px, .6fr) auto; gap: 8px; align-items: end; }
.device-add-form { grid-template-columns: minmax(0, 1fr) auto; margin-top: 4px; }
.customer-add-form { margin-top: 12px; padding: 12px 14px; border: 1px dashed #b7c9df; border-radius: 9px; background: #f8faff; }
.empty-state.compact { min-height: 0; padding: 22px; }
.quota-section { padding-bottom: 4px; }
.quota-card { display: grid; gap: 11px; }
.quota-heading, .quota-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quota-heading > span { color: #344054; font-weight: 700; }
.quota-heading > strong { color: var(--blue); font-size: 22px; }
.quota-heading small { color: var(--muted); font-size: 11px; font-weight: 500; }
.quota-adjust-grid { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(0, 1.3fr); gap: 8px; }
.quota-footer { padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.quota-history { display: grid; gap: 6px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 10px; }
.quota-history > strong { color: #475467; font-size: 11px; }
.quota-history-row { display: grid; grid-template-columns: minmax(150px, .8fr) 64px minmax(0, 1fr) auto; gap: 8px; color: #667085; }
.quota-history-row code { overflow-wrap: anywhere; color: #475467; font-size: 9px; }
.quota-history-row .credit { color: #067647; font-weight: 700; }
.quota-history-row .debit { color: #b42318; font-weight: 700; }
.quota-history-row time { color: #98a2b3; }
.danger-zone { margin-top: 16px; padding: 12px 14px; border: 1px solid #f0c1bd; border-radius: 9px; background: #fffafa; }
.danger-zone > summary { color: var(--red); font-size: 12px; font-weight: 700; cursor: pointer; }
.danger-form { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(170px, .7fr) auto; gap: 9px; align-items: end; padding-top: 12px; }
.danger-form p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle at 15% 25%, #234374 0, transparent 32%), linear-gradient(135deg, #101a2e, #162746); }
.login-shell { width: min(900px, 100%); min-height: 510px; display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; border: 1px solid #ffffff17; border-radius: 18px; background: #ffffff0b; box-shadow: 0 30px 80px #050b1c66; }
.login-brand { padding: 65px 58px; color: white; display: flex; flex-direction: column; justify-content: center; }
.login-brand h1 { margin: 24px 0 12px; font-size: 38px; }
.login-brand > p:last-child { max-width: 390px; color: #b8c5d9; font-size: 16px; line-height: 1.7; }
.login-card { padding: 55px 42px; background: white; display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { font-size: 25px; }
.login-card > .muted { margin-bottom: 25px; }
.login-note { margin: 20px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

.user-software-access { display: grid; gap: 10px; margin: -2px 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; }
.user-software-heading, .user-software-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.user-software-heading select { width: auto; max-width: 100%; }
.user-software-choices { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.user-software-choices label { display: flex; align-items: center; gap: 8px; }
.user-software-choices input { width: 16px; height: 16px; }
.user-software-choices small { display: block; color: var(--muted); }
.user-software-footer small { color: var(--muted); max-width: 75%; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .split-grid { grid-template-columns: 1fr; }
  .device-facts { grid-template-columns: repeat(2, 1fr); }
  .software-form { grid-template-columns: repeat(2, 1fr); }
  .user-facts { grid-template-columns: repeat(2, 1fr); }
  .relation-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px; }
  .brand { padding-bottom: 12px; }
  .sidebar nav { grid-template-columns: repeat(3, 1fr); }
  .sidebar nav a { text-align: center; padding: 9px 5px; font-size: 12px; }
  .sidebar-footer { display: none; }
  .main-content { padding: 22px 14px 40px; }
  .topbar { align-items: center; }
  .workflow { display: none; }
  .detail-grid, .form-grid { grid-template-columns: 1fr; }
  .form-actions { grid-column: auto; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .device-node { margin-left: 0; }
  .device-metadata-form, .software-form { grid-template-columns: 1fr; }
  .device-facts { grid-template-columns: 1fr; }
  .user-facts, .account-actions-grid, .quota-grid { grid-template-columns: 1fr; }
  .quota-adjust-grid { grid-template-columns: 1fr; }
  .relation-form, .danger-form { grid-template-columns: 1fr; }
  .assignment-controls, .inline-edit-form, .assignment-device-row, .device-edit-form, .device-add-form, .customer-add-form { grid-template-columns: 1fr; }
  .danger-form p, .relation-form .button { grid-column: auto; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-card { padding: 45px 28px; }
}
.device-version-panel { margin-bottom: 24px; }
.device-version-table th, .device-version-table td { min-width: 240px; vertical-align: top; }
.device-version-table th:first-child, .device-version-table td:first-child { min-width: 210px; }
.device-version-table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.device-version-table th:first-child { position: sticky; left: 0; background: var(--canvas); z-index: 2; }
.device-version-table td > strong, .device-version-table td > small { display: block; margin-bottom: 6px; }
.version-limit-form { margin-top: 14px; gap: 8px; }
.version-limit-form label { font-size: 12px; }
.version-limit-form select { min-width: 0; width: 100%; }
.version-warning { color: #b45309; }
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .admin-chip { display: none; }
  .form-row { align-items: stretch; flex-direction: column; }
}
