:root {
    --bg: #f5f6f7;
    --card: #fff;
    --ink: #252a32;
    --muted: #6c7480;
    --line: #e2e5e9;
    --blue: #2e62b8;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select { outline-offset: 3px; }
button { cursor: pointer; }
input, select { width: 100%; min-width: 0; border: 1px solid #ccd1d8; border-radius: 4px; background: #fff; padding: 8px 11px; min-height: 38px; color: var(--ink); }
input::placeholder { color: #858d98; }
input:focus, select:focus { border-color: var(--blue); outline: 2px solid #dbe7fa; outline-offset: 0; }
button { border: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.4; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
small { font-size: 12px; }
label { display: flex; min-width: 0; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 500; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 210px; flex-shrink: 0; background: #fafafa; border-right: 1px solid var(--line); padding: 23px 14px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 700; padding: 0 10px; line-height: 1.2; }
.brand-icon { display: block; width: 34px; height: 34px; flex-shrink: 0; object-fit: contain; border-radius: 5px; }
.brand small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 5px; }
nav { margin-top: 34px; }
nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 4px; margin-bottom: 5px; color: #59616d; font-size: 14px; }
nav svg, .exit svg { width: 17px; height: 17px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
nav a:hover { background: #eceff2; }
nav a.active { background: #e9eef7; color: #28589f; font-weight: 600; }
.account { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 16px; margin-top: auto; font-size: 12px; min-width: 0; }
.account > div { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account small { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.avatar, .customer-avatar { display: grid; place-items: center; background: #eceef1; color: #626b77; width: 29px; height: 29px; flex-shrink: 0; border-radius: 4px; }
.exit { display: grid; place-items: center; background: transparent; color: #707987; padding: 5px; border-radius: 3px; }
.exit:hover { background: #e9ecf0; color: var(--ink); }
.main-shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 0 28px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #737b87; }
.breadcrumb { color: #394453; margin-left: 10px; }
.server-status { font-size: 12px; color: #8b929b; }
main { width: 100%; max-width: 1500px; padding: 28px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 23px; gap: 20px; }
.page-heading p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.primary { display: inline-flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; border: 1px solid var(--blue); border-radius: 4px; padding: 8px 15px; min-height: 38px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.primary:hover { background: #254f96; border-color: #254f96; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 19px 0; background: #fff; border: 1px solid var(--line); border-radius: 5px; margin-bottom: 22px; }
.stat { padding: 0 23px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat > span { display: block; font-size: 13px; color: #626b77; }
.stat strong { display: block; font-size: 27px; font-weight: 600; line-height: 1.35; margin: 5px 0 2px; font-variant-numeric: tabular-nums; }
.stat small { font-size: 12px; color: #7c8591; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; margin-bottom: 22px; }
.panel-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; gap: 20px; }
.panel-toolbar span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.search { display: flex; align-items: center; gap: 8px; }
.search input { width: 268px; padding: 7px 10px; font-size: 13px; min-height: 34px; }
.search button { border: 1px solid #ccd1d8; background: #fff; border-radius: 4px; padding: 6px 14px; min-height: 34px; font-size: 13px; color: #485260; white-space: nowrap; }
.search button:hover { background: #f3f5f7; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; text-align: left; font-variant-numeric: tabular-nums; }
th { font-weight: 500; background: #f7f8fa; color: #646e7b; font-size: 13px; padding: 10px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
td { padding: 14px 20px; border-bottom: 1px solid #edf0f3; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfd; }
td strong { font-weight: 500; }
.customer-cell { display: flex; align-items: center; gap: 10px; }
.customer-avatar { font-size: 12px; }
.customer-cell small, .date-cell small, .device-id { display: block; font-size: 12px; color: #7a8492; margin-top: 3px; }
.device-id { font-family: Consolas, monospace; font-size: 11px; }
.badge { display: inline-block; padding: 2px 7px; border-radius: 3px; font-size: 12px; }
.green { background: #edf6f0; color: #3b7955; }
.gray { background: #edf0f3; color: #66717f; }
.amber { background: #fcf4e6; color: #936d29; }
.muted { color: #737e8c; font-size: 12px; }
.danger-link { color: #a75151; background: none; font-size: 13px; padding: 4px 0; }
.danger-link:hover { color: #942b2b; text-decoration: underline; }
.text-link { color: var(--blue); }
.text-link:hover { text-decoration: underline; }
.license-fields { border: 0; padding: 0; margin: 0; display: grid; gap: 17px; min-width: 0; }
.license-fields:disabled { opacity: .75; }
.lifecycle-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 25px; }
.lifecycle-actions form { display: grid; gap: 10px; justify-items: start; }
.danger-button { background: #fff; color: #9c4a42; border: 1px solid #d5b5b1; border-radius: 4px; padding: 8px 14px; }
.danger-button:hover { background: #fcf0ef; }
.check-label { display: flex; flex-direction: row; align-items: center; font-weight: 400; }
.check-label input { width: 16px; min-height: 16px; flex-shrink: 0; }
.audit-detail { white-space: normal; max-width: 500px; }
.audit-detail summary { color: var(--blue); cursor: pointer; }
.audit-detail pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f7f8fa; padding: 8px; margin: 8px 0; }
.empty-state { padding: 36px 12px 40px; text-align: center; white-space: normal; }
.empty-state h3 { font-size: 14px; font-weight: 500; color: #687381; }
.empty-state p { font-size: 13px; color: #7d8794; margin-top: 5px; }
.pagination { border-top: 1px solid var(--line); padding: 11px 20px; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.pagination div { display: flex; gap: 18px; }
.pagination a { color: var(--blue); }
footer { margin: auto 28px 20px; padding-top: 2px; color: #9299a3; font-size: 12px; }
.create-panel { padding: 22px 24px 24px; scroll-margin-top: 20px; }
.create-explainer { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.create-explainer p { font-size: 13px; color: var(--muted); margin-top: 5px; }
.create-form { display: grid; gap: 17px; max-width: 900px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.create-form > label { max-width: 440px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; padding-top: 3px; gap: 15px; }
.form-actions > span { font-size: 12px; color: var(--muted); }
.notice { padding: 12px 15px; background: #edf6f0; color: #376d4b; border: 1px solid #d2e5d9; border-radius: 4px; margin-bottom: 20px; font-size: 13px; }
.notice.error { background: #fcf0ef; border-color: #eed7d5; color: #9c4a42; }
.notice ul { padding-left: 20px; margin-bottom: 0; }
.license-reveal { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 20px; background: #eff4fb; border: 1px solid #d4e1f3; border-radius: 4px; margin-bottom: 22px; font-size: 13px; }
.license-reveal p { font-size: 12px; color: #647994; margin-top: 4px; }
.license-reveal code { font-family: Consolas, monospace; user-select: all; word-break: break-all; font-size: 13px; color: #285a9e; }
.login-body { min-height: 100vh; background: #f5f6f7; display: flex; flex-direction: column; }
.login-layout { display: flex; align-items: center; justify-content: center; width: 100%; padding: 60px 20px 45px; flex: 1; }
.login-card { width: 420px; background: #fff; border: 1px solid #dde1e6; border-radius: 6px; padding: 34px; }
.login-brand { margin-bottom: 31px; padding: 0; }
.login-card h1 { font-size: 22px; margin-bottom: 5px; }
.login-card > p { color: var(--muted); font-size: 13px; margin-bottom: 27px; }
.login-card form { display: grid; gap: 20px; }
.login-card input { min-height: 41px; }
.login-button { margin-top: 3px; min-height: 41px; font-size: 14px; }
.login-help { margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); color: #7a8390; font-size: 12px; }
.login-footer { margin: 0 20px 23px; text-align: center; }
@media (max-width: 1100px) {
    .sidebar { width: 192px; padding: 23px 12px 18px; }
    main { padding: 24px; }
    .stat { padding: 0 18px; }
    th, td { padding-left: 16px; padding-right: 16px; }
    .search input { width: 240px; }
}
@media (max-width: 780px) {
    .sidebar { width: 168px; padding: 20px 10px 16px; }
    .brand { font-size: 19px; padding: 0 6px; gap: 8px; }
    .brand small { font-size: 11px; }
    .brand-icon { width: 30px; height: 32px; }
    .topbar { padding: 0 20px; }
    main { padding: 22px 20px; }
    .page-heading { align-items: flex-start; }
    .page-heading h1 { font-size: 22px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 0; }
    .stat:nth-child(2) { border-right: 0; }
    .panel-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; padding: 16px; }
    .search { width: 100%; }
    .search input { flex: 1; width: auto; }
    .create-panel { padding: 20px; }
    .form-row { grid-template-columns: 1fr; gap: 17px; }
    .create-form > label { max-width: none; }
    .form-actions { align-items: flex-start; flex-direction: column; }
    .license-reveal { align-items: flex-start; flex-direction: column; }
    footer { margin-left: 20px; margin-right: 20px; }
}
@media (max-width: 540px) {
    .app-shell { display: block; }
    .sidebar { width: 100%; height: auto; position: static; padding: 16px 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar .brand small { display: none; }
    .sidebar .brand-icon { width: 26px; height: 26px; font-size: 19px; }
    nav { display: flex; margin-top: 15px; gap: 5px; }
    nav a { flex: 1; justify-content: center; font-size: 12px; gap: 6px; padding: 9px 5px; margin: 0; white-space: nowrap; }
    nav svg { width: 14px; height: 14px; }
    .account { margin-top: 13px; padding-top: 12px; }
    .account > div { display: flex; align-items: center; gap: 8px; }
    .account small { max-width: 170px; }
    .account .avatar { width: 24px; height: 24px; font-size: 11px; }
    .topbar { height: 44px; padding: 0 16px; font-size: 12px; }
    main { padding: 22px 16px; }
    .page-heading { gap: 12px; }
    .page-heading h1 { font-size: 20px; }
    .page-heading p { font-size: 12px; }
    .page-heading .primary { padding: 7px 10px; font-size: 12px; }
    .stat { padding: 0 17px; }
    .create-panel { padding: 18px; }
    .login-layout { padding: 25px 18px; }
    .login-card { width: 100%; padding: 28px 25px; }
}
