:root {
  --nav: #142a3b;
  --nav-hover: #213e50;
  --nav-muted: #9cb0bd;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-alt: #f8fafb;
  --ink: #213545;
  --muted: #596c79;
  --line: #dfe7ec;
  --line-strong: #c7d4dc;
  --teal: #087f70;
  --teal-dark: #066456;
  --teal-soft: #e8f5f1;
  --red: #b64040;
  --red-soft: #fff1ef;
  --amber: #986211;
  --amber-soft: #fff6e5;
  --blue-soft: #eef5fa;
  --radius: 10px;
  --shadow: 0 16px 44px rgba(0, 0, 0, .16);
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { line-height: 1.55; background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
a:focus-visible, summary:focus-visible { outline: 3px solid #4caf9d; outline-offset: 2px; }
input, textarea { caret-color: var(--teal); }
input::placeholder, textarea::placeholder { color: #637581; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 10; height: 100vh; display: flex; flex-direction: column; padding: 27px 15px 17px; color: #fff; background: var(--nav); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 29px; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid #5d7d8d; border-radius: 8px; color: #a9dfd4; font-weight: 700; }
.brand-name { font-size: 16px; font-weight: 650; letter-spacing: .01em; }
.brand small { display: block; margin-top: 1px; color: var(--nav-muted); font-size: 11px; letter-spacing: .13em; }
.nav-group { margin: 14px 0 4px; }
.nav-group-label { padding: 0 12px 7px; color: #91aab9; font-size: 11px; letter-spacing: .1em; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; margin: 2px 0; padding: 10px 12px; border: 0; border-radius: 7px; background: transparent; color: #b6c8d3; text-align: left; font-size: 13px; transition: background .16s, color .16s; }
.nav-item:hover { background: var(--nav-hover); color: #fff; }
.nav-item.active { background: #225052; color: #e5faf4; }
.nav-item.active::after { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: #89d8c5; content: ""; }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; }
.side-footer { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 17px 9px 0; border-top: 1px solid #385363; }
.side-footer .avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: #304c5d; color: #e3eff4; font-size: 12px; font-weight: 600; }
.side-footer .user-info { min-width: 0; flex: 1; }
.side-footer .user-info strong { display: block; overflow: hidden; color: #eff6fa; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.side-footer .user-info small { color: var(--nav-muted); font-size: 11px; }
.side-footer button { padding: 5px; border: 0; background: transparent; color: var(--nav-muted); }

.main { min-width: 0; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 36px; border-bottom: 1px solid var(--line); background: var(--surface); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: var(--ink); font-weight: 550; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.content { width: min(100%, 1700px); margin: 0 auto; padding: 34px 36px 54px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: 27px; line-height: 1.28; letter-spacing: -.025em; }
.page-head p { max-width: 70ch; margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }

.btn { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover:not(:disabled) { border-color: #aabdc8; background: #f0f4f6; }
.btn.primary { border-color: var(--teal); background: var(--teal); color: #fff; }
.btn.primary:hover:not(:disabled) { border-color: var(--teal-dark); background: var(--teal-dark); }
.btn.danger { border-color: #e6beb8; background: #fff; color: var(--red); }
.btn.danger:hover:not(:disabled) { background: var(--red-soft); }
.btn.subtle { border-color: transparent; background: transparent; color: var(--muted); }
.btn.subtle:hover:not(:disabled) { background: #eef2f4; color: var(--ink); }
.btn.small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.btn.icon { width: 40px; height: 40px; padding: 8px; }
.link { border: 0; background: transparent; color: var(--teal); font-weight: 550; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--red); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 17px 21px; border-bottom: 1px solid var(--line); }
.toolbar .search { position: relative; min-width: 190px; max-width: 350px; flex: 1; }
.toolbar .search input { width: 100%; padding-left: 35px; }
.toolbar .search svg { position: absolute; top: 10px; left: 11px; width: 17px; height: 17px; color: var(--muted); }
.toolbar select { width: auto; min-width: 135px; }
.field input, .field select, .field textarea, .input { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid #cad7df; border-radius: 7px; background: #fff; }
.field textarea { min-height: 95px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > span { font-size: 13px; font-weight: 550; }
.field small, .help, .hint { color: var(--muted); font-size: 12px; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-grid .span-2, .span-2 { grid-column: 1 / -1; }
.check-grid { display: flex; flex-wrap: wrap; gap: 11px 17px; padding-top: 7px; }
.check-item { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--teal); }

.panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel + .panel { margin-top: 21px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px 23px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 620; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.panel-body { padding: 23px; }
.table-wrap { overflow-x: auto; scrollbar-color: #bfccd3 #f3f6f8; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
thead { background: var(--surface-alt); color: var(--muted); font-size: 11px; }
th { padding: 12px 17px; font-weight: 550; }
td { padding: 16px 17px; border-top: 1px solid #e8eef1; font-size: 12px; vertical-align: middle; }
tbody tr:hover { background: #fbfcfd; }
td.wrap { max-width: 330px; min-width: 160px; white-space: normal; overflow-wrap: anywhere; }
.check-cell { width: 43px; padding-right: 0; }
.ops { display: flex; align-items: center; gap: 10px; }
.subline { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.number { font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; padding: 3px 8px; background: #edf1f4; color: #516774; font-size: 11px; }
.badge::before { width: 6px; height: 6px; border-radius: 50%; background: #8395a0; content: ""; }
.badge.active, .badge.online, .badge.ok { background: var(--teal-soft); color: #176c5e; }
.badge.active::before, .badge.online::before, .badge.ok::before { background: #198a75; }
.badge.banned, .badge.void, .badge.kicked { background: var(--red-soft); color: var(--red); }
.badge.banned::before, .badge.void::before, .badge.kicked::before { background: var(--red); }
.badge.expired, .badge.paused, .badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.expired::before, .badge.paused::before, .badge.warn::before { background: #b17a1e; }
.badge.unused { background: var(--blue-soft); color: #496b82; }
.badge.unused::before { background: #628da8; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; padding: 10px 21px; border-bottom: 1px solid #d3e8e2; background: var(--teal-soft); color: #176c5e; font-size: 12px; }
.bulk-bar strong { font-weight: 650; }
.bulk-bar .push { margin-left: auto; }
.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 19px; padding: 12px 15px; border: 1px solid #e5d5ac; border-radius: 8px; background: var(--amber-soft); color: #765114; font-size: 13px; }
.alert p { flex: 1; margin: 0; }
.alert.error { border-color: #e6c1bc; background: var(--red-soft); color: var(--red); }
.alert.success { border-color: #bcddd4; background: var(--teal-soft); color: #176c5e; }
.empty { padding: 54px 22px 60px; text-align: center; }
.empty .empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 12px; background: #f0f4f6; color: #718a99; }
.empty h3 { margin: 0 0 6px; font-size: 15px; }
.empty p { max-width: 53ch; margin: 0 auto 17px; color: var(--muted); font-size: 12px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 21px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.summary-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; }
.summary-item + .summary-item { border-left: 1px solid var(--line); }
.summary-item span { color: var(--muted); font-size: 12px; }
.summary-item b { display: block; margin-top: 4px; font-size: 25px; font-weight: 620; line-height: 1.3; }
.summary-item svg { width: 20px; height: 20px; color: #8097a5; }

.drawer-backdrop { position: fixed; z-index: 40; inset: 0; display: flex; justify-content: flex-end; background: rgba(10, 30, 45, .44); }
.drawer { width: min(640px, 100%); height: 100%; display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow); animation: drawer-in .18s ease-out; }
@keyframes drawer-in { from { transform: translateX(22px); opacity: .8; } to { transform: translateX(0); opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; gap: 14px; padding: 23px 26px 19px; border-bottom: 1px solid var(--line); }
.drawer-head > div { flex: 1; }
.drawer-head h2 { margin: 0 0 4px; font-size: 19px; }
.drawer-head p { margin: 0; color: var(--muted); font-size: 12px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 26px; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 26px; border-top: 1px solid var(--line); background: #fafcfd; }
.detail-list { display: grid; grid-template-columns: 125px minmax(0, 1fr); gap: 12px 16px; margin: 0; font-size: 13px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.code-box { margin: 15px 0 0; padding: 16px; overflow: auto; border-radius: 7px; background: #f2f6f8; color: #294b60; font: 12px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.action-menu { position: absolute; z-index: 30; min-width: 160px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 12px 35px rgba(0, 0, 0, .16); }
.action-menu button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; text-align: left; font-size: 12px; }
.action-menu button:hover { background: #f1f5f7; }
.toast { position: fixed; z-index: 100; bottom: 25px; left: 50%; max-width: calc(100% - 32px); transform: translateX(-50%); padding: 12px 19px; border-radius: 8px; background: #213b4c; color: #fff; box-shadow: 0 9px 26px rgba(0, 0, 0, .22); font-size: 13px; }
.toast.error { background: #853b3b; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 42%) minmax(0, 1fr); background: #fff; }
.login-aside { display: flex; flex-direction: column; padding: 54px 12%; background: var(--nav); color: #fff; }
.login-aside .brand { padding: 0; }
.login-aside-content { max-width: 360px; margin: auto 0; padding: 80px 0; }
.login-aside-content h1 { margin: 0; font-size: 34px; line-height: 1.45; letter-spacing: -.025em; }
.login-aside-content p { margin: 21px 0 32px; color: #bbced9; font-size: 13px; line-height: 1.9; }
.login-aside-content li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid #385468; color: #c4d5df; font-size: 12px; list-style: none; }
.login-aside-content ul { margin: 0; padding: 0; }
.login-aside-footer { color: #96afbf; font-size: 11px; }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-form { width: min(100%, 355px); }
.login-form h2 { margin: 0 0 8px; font-size: 25px; }
.login-form > p { margin: 0 0 29px; color: var(--muted); font-size: 13px; }
.login-form .field { margin-bottom: 18px; }
.login-form .btn.primary { width: 100%; margin-top: 9px; }

.mobile-menu { display: none; }
.mobile-scrim { display: none; }
@media (max-width: 1120px) {
  .shell { grid-template-columns: 196px minmax(0, 1fr); }
  .sidebar { padding-left: 11px; padding-right: 11px; }
  .topbar, .content { padding-left: 26px; padding-right: 26px; }
  .summary-item { padding: 18px; }
}
@media (max-width: 800px) {
  .shell { display: block; }
  .sidebar { position: fixed; left: 0; width: 230px; transform: translateX(-100%); transition: transform .18s ease-out; }
  .shell.menu-open .sidebar { transform: translateX(0); }
  .shell.menu-open::after { position: fixed; z-index: 9; inset: 0; display: block; background: rgba(12, 35, 51, .43); content: ""; }
  .mobile-menu { display: inline-flex; }
  .topbar { height: 62px; padding: 0 17px; }
  .topbar-actions .status { display: none; }
  .content { padding: 26px 17px 42px; }
  .page-head { flex-direction: column; margin-bottom: 22px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .primary { margin-left: auto; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-item { padding: 17px; }
  .summary-item:nth-child(3), .summary-item:nth-child(4) { border-top: 1px solid var(--line); }
  .summary-item:nth-child(3) { border-left: 0; }
  .summary-item b { font-size: 22px; }
  .toolbar { padding: 15px; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .toolbar select { min-width: 0; flex: 1; }
  .toolbar .btn { min-height: 42px; }
  .btn { min-height: 43px; }
  .btn.small { min-height: 37px; }
  .panel-head { padding: 18px; }
  .panel-body { padding: 19px; }
  .bulk-bar { padding: 10px 15px; }
  .drawer-head { padding: 20px; }
  .drawer-body { padding: 20px; }
  .drawer-foot { padding: 14px 20px; }
  .login-page { display: block; }
  .login-aside { min-height: auto; padding: 24px; }
  .login-aside-content, .login-aside-footer { display: none; }
  .login-panel { display: block; padding: 47px 27px 70px; }
  .login-form { max-width: 400px; margin: 0 auto; }
}
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; gap: 15px; }
  .form-grid .span-2, .span-2 { grid-column: auto; }
  .page-head .actions .primary { margin-left: 0; }
  .page-head .actions .btn { flex: 1; }
  .pager { align-items: flex-start; flex-direction: column; }
  .pager .actions { width: 100%; justify-content: flex-end; }
  .detail-list { grid-template-columns: 1fr; gap: 3px; }
  .detail-list dd { margin-bottom: 10px; }
  .drawer { width: 100%; }
  .topbar .breadcrumb > span { display: none; }
  .topbar-actions .btn { padding: 7px 9px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Composition shared by the concrete management screens. */
[v-cloak] { display: none; }
body { line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
.brand { color: inherit; text-decoration: none; }
.sidebar nav { overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.sidebar .user-info { display: flex; align-items: center; gap: 8px; }
.side-footer { flex-wrap: wrap; }
.side-footer .btn { font-size: 11px; }
.actions { display: flex; align-items: center; gap: 8px; }
.overview-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; margin-bottom: 22px; }
.overview-grid .panel { margin-top: 0; }
.summary-item { flex-direction: column; align-items: flex-start; gap: 2px; }
.summary-item strong { font-size: 30px; font-weight: 650; line-height: 1.4; font-variant-numeric: tabular-nums; }
.summary-item small { font-size: 11px; }
.resource-list button { display: flex; align-items: center; gap: 18px; width: 100%; padding: 23px; border: 0; border-bottom: 1px solid var(--line); background: white; color: var(--ink); text-align: left; }
.resource-list button:last-child { border-bottom: 0; }
.resource-list button:hover { background: var(--surface-alt); }
.resource-list button > svg:first-child { color: var(--teal); width: 24px; height: 24px; }
.resource-list button > svg:last-child { margin-left: auto; flex-shrink: 0; }
.resource-list strong, .resource-list span { display: block; }
.resource-list span { margin-top: 4px; color: var(--muted); font-size: 12px; }
hr { height: 1px; border: 0; background: var(--line); margin: 24px 0; }
.detail-list > span { color: var(--muted); }
.detail-list > strong { overflow-wrap: anywhere; font-weight: 550; }
.toolbar input, .toolbar select { min-height: 39px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: white; min-width: 0; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.empty > svg { width: 32px; height: 32px; color: var(--muted); margin-bottom: 7px; }
.empty > span { color: var(--muted); font-size: 13px; }
.empty .btn { margin-top: 7px; }
.drawer-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer-body > .form-grid { margin-top: 10px; }
.check-item input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; padding: 0; flex: 0 0 16px; }
.required { color: var(--red); }
.toast { display: flex; align-items: center; gap: 9px; }
.settings-panel { max-width: 1000px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 14px 0; }
.settings-row + .settings-row { border-top: 1px solid var(--line); margin-top: 12px; }
.settings-row h3 { margin: 0; font-size: 14px; }
.settings-row p { margin: 5px 0 0; font-size: 13px; }
.integration-guide { display: flex; align-items: center; gap: 16px; padding: 18px 0 25px; }
.integration-guide > svg { color: var(--teal); flex-shrink: 0; }
.integration-guide p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.integration-guide > div { flex: 1; }
.loading-line { height: 2px; background: var(--teal); margin-bottom: 12px; }
.login-aside-content .brand { margin-bottom: 60px; }
.login-feature { display: flex; align-items: center; gap: 10px; padding-top: 20px; border-top: 1px solid #385468; color: #c4d5df; font-size: 12px; }
.login-form .login-note { margin-top: 23px; font-size: 11px; text-align: center; }
@media (max-width: 1120px) { .overview-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .shell.menu-open::after { display: none; }
  .mobile-scrim { display: block; position: fixed; z-index: 9; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(12,35,51,.43); }
  .login-aside-content { display: block; padding: 0; }
  .login-aside-content .brand { margin: 0; }
  .login-aside-content h1, .login-aside-content > p, .login-feature { display: none; }
  .toolbar select { max-width: 100%; }
  .integration-guide { align-items: flex-start; flex-wrap: wrap; }
  .integration-guide .btn { margin-left: 36px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .badge { font-size: 11px; }
}
@media (max-width: 520px) {
  .settings-row { flex-direction: column; align-items: flex-start; }
  .detail-list > strong { margin-bottom: 10px; }
  .toolbar { gap: 8px; }
  .toolbar > .muted { width: 100%; }
  .page-head h1 { font-size: 25px; }
}

/* Keep row actions reachable while wide records scroll. */
table:has(.ops) th:last-child, table:has(.ops) td:last-child { position: sticky; right: 0; background: var(--surface); box-shadow: -1px 0 0 var(--line); }
table:has(.ops) th:last-child { background: var(--surface-alt); }
.ops { gap: 2px; }
@media (max-width:520px) { .ops .btn.small { padding: 5px 6px; } }
