:root{color-scheme:light;--ink:#142b3b;--muted:#6b7d87;--accent:#087c75;--line:#dfe8e8}*{box-sizing:border-box}body{margin:0;background:#f4f7f7;color:var(--ink);font:14px/1.6 system-ui,-apple-system,"Microsoft YaHei",sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer;background:var(--accent);color:white;border:0;border-radius:7px;padding:10px 17px}button:disabled{opacity:.5;cursor:wait}.quiet{background:#e7eeee;color:var(--ink)}.danger{background:#fff0ee;color:#a1352e}button+button{margin-left:7px}input,select,textarea{display:block;width:100%;padding:10px 12px;border:1px solid #cedada;border-radius:6px;background:#fff;color:var(--ink)}textarea{min-height:90px;resize:vertical}label{display:block;margin:15px 0 6px;font-weight:600}label .muted{font-weight:400;font-size:12px}input[type=checkbox],input[type=radio]{display:inline;width:auto;margin-right:9px}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}.muted{color:var(--muted)}.brand{font-size:20px;font-weight:800;letter-spacing:2px;margin-bottom:8px}.login{max-width:440px;margin:9vh auto;padding:35px;background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 15px 60px #12332609}.login h1{font-size:26px;margin-top:32px}.login button{width:100%;margin-top:24px}aside{position:fixed;top:0;bottom:0;left:0;width:220px;padding:32px 22px;background:#133339;color:#fff}aside .muted{color:#9db4b5}nav{margin:35px 0}nav button{display:block;width:100%;text-align:left;background:transparent;color:#bad0d0;margin:5px 0!important}nav button.active{background:#23545a;color:#fff}.workspace{margin-left:220px;padding:32px 42px;max-width:1600px}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:28px}h1{font-size:29px;margin:5px 0}h2{font-size:20px;margin-top:0}.eyebrow{font-size:11px;letter-spacing:3px;color:var(--accent)}.badge{display:inline-block;background:#e0f0ea;color:#1a7662;border-radius:20px;padding:3px 10px;font-size:12px;margin-right:8px}.warning{background:#fff4df;border:1px solid #ead3a4;color:#805c1c;padding:15px 20px;border-radius:9px;margin:20px 0}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:25px}.card,.panel{background:white;border:1px solid var(--line);border-radius:12px;padding:23px}.card strong{display:block;font-size:32px;margin-top:10px}.panel{margin-bottom:20px}.toolbar{display:flex;gap:10px;align-items:center;margin-bottom:20px}.toolbar input{max-width:350px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;white-space:nowrap}th{text-align:left;color:var(--muted);font-weight:500;background:#f8faf9}th,td{padding:12px 14px;border-bottom:1px solid #edf1f1}td button{font-size:12px;padding:6px 10px}td.long{max-width:330px;overflow:hidden;text-overflow:ellipsis}.empty{text-align:center;padding:45px;color:var(--muted)}.grid{display:grid;grid-template-columns:1fr 1fr;gap:0 20px}.checks{display:grid;grid-template-columns:repeat(5,1fr);gap:4px}.checks label{font-weight:400;margin:5px 0}dialog{border:1px solid var(--line);border-radius:14px;padding:28px;width:min(760px,94vw);max-height:90vh;color:var(--ink)}dialog::backdrop{background:#102e3c60}.dialog-head{display:flex;align-items:center;justify-content:space-between}form .actions{margin-top:24px;display:flex;justify-content:flex-end}.small{font-size:12px}.status{color:#9b5423}.mono{font-family:ui-monospace,monospace;overflow-wrap:anywhere}pre{white-space:pre-wrap;background:#f1f6f5;padding:20px;border-radius:8px}#toast{position:fixed;right:25px;top:20px;z-index:100;background:#173c42;color:#fff;padding:12px 23px;border-radius:8px;display:none;max-width:90vw}[hidden]{display:none!important}@media(max-width:850px){aside{position:static;width:auto;padding:15px}nav{display:flex;overflow:auto;margin:15px 0}nav button{width:auto;flex-shrink:0}.workspace{margin:0;padding:20px}.cards{grid-template-columns:1fr 1fr}.grid{grid-template-columns:1fr}.checks{grid-template-columns:repeat(3,1fr)}header{align-items:flex-start}.login{margin:5vh 15px}}

.expiry-options{display:flex;flex-wrap:wrap;gap:8px 20px}.expiry-options label{white-space:nowrap}

#enrollmentQr{display:flex;justify-content:center;background:white;padding:16px}#enrollmentSecret{overflow-wrap:anywhere}#enrollment{max-width:560px}
#batchEditor{width:min(1280px,96vw)}.batch-row{border:1px solid var(--line);border-radius:10px;margin:18px 0;padding:14px 18px;background:#f8faf9}.batch-number{font-weight:700;padding:0 8px}.batch-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0 14px}.batch-grid label{font-size:13px;margin-top:8px}.batch-row-actions{display:flex;justify-content:space-between;align-items:center;gap:12px}.batch-row-actions label{font-weight:400}#batchResults{min-height:200px}#batchError{position:sticky;top:0;z-index:1}@media(max-width:1000px){.batch-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:550px){.batch-grid{grid-template-columns:1fr}.toolbar{flex-wrap:wrap}.batch-row{padding:12px}}
.domain-message{white-space:normal;min-width:240px;max-width:420px}

.link-pagination{flex-wrap:wrap}.link-pagination label,.link-pagination form{display:flex;align-items:center;gap:8px;margin:0}.link-pagination input{width:85px}.link-pagination select{width:auto}

#visitsDialog{width:min(1440px,96vw);max-width:96vw}#visitsDialog>.toolbar{flex-wrap:wrap}#visitsPage{display:flex;align-items:center;gap:8px;margin:0;flex-wrap:nowrap}#visitsPage input{width:85px;flex:none}#visitsPage button{white-space:nowrap}#visitsDialog table{white-space:normal}#visitsDialog th,#visitsDialog td{padding:10px;overflow-wrap:anywhere}#visitsDialog td:nth-child(4),#visitsDialog td:nth-child(5){min-width:100px}@media(max-width:600px){#visitsDialog{padding:16px}#visitsDialog table{min-width:720px}}

/* Link management: sticky column headers. */
#content:has(#filter)>.panel .table-wrap{max-height:75vh;overflow:auto}
#content:has(#filter)>.panel th{position:sticky;top:0;z-index:2;background:#f8faf9;box-shadow:0 1px 0 var(--line)}

/* Link management: use available width and wrap wide cells. */
.workspace:has(#filter){max-width:none;padding-left:28px;padding-right:28px;min-width:0}
#content:has(#filter)>.toolbar{flex-wrap:wrap}
#content:has(#filter)>.panel{padding:16px}
#content:has(#filter)>.panel table{table-layout:fixed;white-space:normal;min-width:1100px}
#content:has(#filter)>.panel th,#content:has(#filter)>.panel td{padding:10px 6px;overflow-wrap:anywhere}
#content:has(#filter)>.panel td.long{max-width:none;overflow:visible;text-overflow:clip}
#content:has(#filter)>.panel th:nth-child(1){width:3%}
#content:has(#filter)>.panel th:nth-child(2){width:8%}
#content:has(#filter)>.panel th:nth-child(3),#content:has(#filter)>.panel th:nth-child(4){width:12%}
#content:has(#filter)>.panel th:nth-child(5),#content:has(#filter)>.panel th:nth-child(6),#content:has(#filter)>.panel th:nth-child(7){width:4%}
#content:has(#filter)>.panel th:nth-child(8),#content:has(#filter)>.panel th:nth-child(13){width:5%}
#content:has(#filter)>.panel th:nth-child(9),#content:has(#filter)>.panel th:nth-child(10),#content:has(#filter)>.panel th:nth-child(11){width:6%}
#content:has(#filter)>.panel th:nth-child(12){width:8%}
#content:has(#filter)>.panel th:nth-child(14){width:10%}
#content:has(#filter)>.panel th:nth-child(15){width:7%}
#content:has(#filter)>.panel td:nth-child(14) button{margin:2px;padding:5px 7px;white-space:nowrap}
@media(max-width:850px){.workspace:has(#filter){padding:20px}}
@media(min-width:1440px){#content:has(#filter)>.panel .table-wrap{max-height:none;overflow:visible}}
