/* RdpBan 云控制台 — 一套很短的样式表：冷灰底、白卡片、青蓝点缀。 */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --line: #e3e8ef;
  --line-soft: #eef2f7;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #8492a6;
  --accent: #0e7490;
  --accent-soft: #e6f4f8;
  /* 「同步中」用它：明显偏蓝，和「已同步」的淡绿一眼能分开 */
  --blue: #1d4ed8;
  --blue-soft: #e6ecfd;
  --green: #047857;
  --green-soft: #e7f6ef;
  --amber: #b45309;
  --amber-soft: #fdf1e3;
  --red: #b91c1c;
  --red-soft: #fdeaea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.side {
  background: #0b1524;
  color: #cbd5e1;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(145deg, #22d3ee, #0e7490);
  position: relative; flex: 0 0 auto;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 7px 9px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 3px 3px 6px 6px;
}
.brand-text { font-weight: 650; font-size: 15px; line-height: 1.25; letter-spacing: .2px; }
.brand-text small { display: block; font-weight: 400; font-size: 11px; color: #7c8da3; letter-spacing: .8px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: block; padding: 9px 12px; border-radius: 10px;
  color: #a7b6c9; font-size: 14px; text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item.on { background: rgba(34, 211, 238, .12); color: #e6fbff; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.side-foot .who { color: #e2e8f0; font-size: 14px; }
.side-foot .who small { margin-left: 6px; color: #7c8da3; font-size: 11px; }
.link-quiet { color: #7c8da3; font-size: 13px; }

.main { padding: 30px 34px 46px; min-width: 0; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.topbar h1 { font-size: 22px; margin: 0; letter-spacing: -.2px; font-weight: 650; }
.topbar-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.topbar-title h1 { flex: none; }
/* 操作反馈：跟在标题后面的一枚小标签，不另起一行，8 秒后自己淡掉 */
.flash {
  font-size: 12.5px; line-height: 1.7; color: var(--green); background: var(--green-soft);
  border-radius: 999px; padding: 2px 10px;
  animation: flash-fade 8s forwards;
}
.flash.warn { color: var(--amber); background: var(--amber-soft); }
@keyframes flash-fade { 0%, 82% { opacity: 1; } 100% { opacity: 0; } }
.topbar-actions { display: flex; gap: 8px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 26px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.card .k { color: var(--ink-3); font-size: 12px; letter-spacing: .6px; }
.card .v { font-size: 26px; font-weight: 650; margin-top: 6px; letter-spacing: -.5px; }
.card .s { color: var(--ink-2); font-size: 12px; margin-top: 2px; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { font-size: 15px; margin: 0; font-weight: 650; }
.panel-head .hint { color: var(--ink-3); font-size: 12px; }
.panel-body { padding: 18px; }
/* 表宽超过面板时横向滚动，不要悄悄裁掉右边那几列 */
.panel-body.flush { padding: 0; overflow-x: auto; }

/* 看起来像链接的按钮：客户端列表里的「管理」 */
.linkbtn { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--accent); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }

/* 弹窗：只在需要的时候出现，点遮罩或 Esc 关掉 */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 23, 42, .42); z-index: 40; }
.modal.on { display: flex; }
.sheet { width: min(560px, 94vw); background: var(--panel); border-radius: 16px; box-shadow: 0 24px 60px -18px rgba(15, 23, 42, .5); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.sheet-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.sheet-head .x { border: 0; background: none; color: var(--ink-3); font-size: 22px; line-height: 1; cursor: pointer; }
.sheet-head .x:hover { color: var(--ink); }
.sheet-body { padding: 16px 18px 6px; }
.sheet-body .field { margin-bottom: 12px; }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line-soft); }

/* 列表页的查询条：一个输入框 + 按钮，命中数跟在后面 */
.search { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search input.q { flex: 0 1 320px; min-width: 160px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 13px; }
.search input.q:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 116, 144, .12); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { color: var(--ink-3); font-weight: 500; font-size: 12px; letter-spacing: .4px; background: #fafbfd; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcff; }
td.mono, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
/* 数字列和其他列一样左对齐，只保留等宽数字，避免一列单独靠右 */
.num { text-align: left; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; line-height: 1.6; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.green { color: var(--green); background: var(--green-soft); }
.pill.amber { color: var(--amber); background: var(--amber-soft); }
.pill.red   { color: var(--red); background: var(--red-soft); }
.pill.grey  { color: #64748b; background: #eef1f5; }
.pill.accent{ color: var(--blue); background: var(--blue-soft); }
/* 空心点：不靠颜色也能看出这是「在途」而不是「已完成」 */
.pill.accent::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; opacity: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13.5px; cursor: pointer;
  text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #0b6478; }
.btn.danger { color: var(--red); border-color: #f3d3d3; background: #fff; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

form.inline { display: inline; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--ink-2); }
.field input, .field select, .field textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 13.5px; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: #7cc3d4; box-shadow: 0 0 0 3px rgba(14, 116, 144, .12);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; }

.note { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: #0b5563; font-size: 13px; }
.note.warn { background: var(--amber-soft); color: #8a4408; }
.note.danger { background: var(--red-soft); color: #8c1414; }
.note + .note { margin-top: 10px; }

.empty { padding: 40px 18px; text-align: center; color: var(--ink-3); font-size: 13.5px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(900px 420px at 12% -10%, #e7f6fa 0%, transparent 60%),
  radial-gradient(700px 380px at 100% 0%, #eef2f7 0%, transparent 55%), var(--bg); }
.login-card {
  width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 30px 28px; box-shadow: 0 18px 50px -28px rgba(15, 23, 42, .3);
}
.login-card h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.3px; }
.login-card p.lead { margin: 0 0 22px; color: var(--ink-3); font-size: 13px; }
.login-foot { margin-top: 16px; color: var(--ink-3); font-size: 12px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: column; gap: 14px; padding: 16px; }
  .side .nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin-top: 0; flex-direction: row; align-items: center; gap: 12px; }
  .main { padding: 20px 16px 34px; }
  .topbar h1 { font-size: 19px; }
}
