:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e7ebf3;
  --line-soft: #eef2f7;
  --primary: #1677ff;
  --primary-deep: #0b5ed7;
  --primary-soft: #eaf2ff;
  --success: #12b76a;
  --success-soft: #e8f8ef;
  --warning: #f5a623;
  --warning-deep: #dc6803;
  --warning-soft: #fff6e8;
  --danger: #f04438;
  --danger-soft: #fef0ef;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-md: 0 12px 32px -12px rgba(16, 24, 40, .16), 0 4px 12px rgba(16, 24, 40, .04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 82% -10%, rgba(22, 119, 255, .09), transparent 60%),
    radial-gradient(760px 420px at 2% 8%, rgba(127, 86, 217, .05), transparent 62%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font-family: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

code {
  font-family: var(--mono);
  font-size: .88em;
  background: #f2f4f7;
  border: 1px solid #eaecf0;
  border-radius: 6px;
  padding: 1px 6px;
  color: #344054;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--primary);
}

/* ---------------------------------------------------------------- brand */
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #3b93ff, #0b5ed7);
  box-shadow: 0 10px 24px -8px rgba(22, 119, 255, .65);
}

.brand-mark svg { width: 26px; height: 26px; }

.brand-mark-sm {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  box-shadow: 0 6px 14px -6px rgba(22, 119, 255, .55);
}

.brand-mark-sm svg { width: 19px; height: 19px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; }
.brand-text span {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 2px;
}

/* ---------------------------------------------------------------- auth */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(900px 520px at 18% 8%, rgba(22, 119, 255, .16), transparent 64%),
    radial-gradient(760px 500px at 88% 92%, rgba(127, 86, 217, .13), transparent 60%),
    #f6f8fd;
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 24, 40, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 40, .045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 74%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 74%);
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .6;
}

.orb-a {
  width: 420px;
  height: 420px;
  top: -160px;
  right: -100px;
  background: radial-gradient(circle at 35% 35%, rgba(22, 119, 255, .35), transparent 66%);
}

.orb-b {
  width: 360px;
  height: 360px;
  bottom: -150px;
  left: -90px;
  background: radial-gradient(circle at 60% 40%, rgba(127, 86, 217, .3), transparent 68%);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  padding: 38px 36px 28px;
  box-shadow: 0 32px 80px -36px rgba(16, 24, 40, .34), 0 2px 6px rgba(16, 24, 40, .04);
  animation: rise .55s cubic-bezier(.2, .8, .2, 1) both;
}

.auth-card .brand-mark { margin-bottom: 22px; }

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -.03em;
}

.auth-sub {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.auth-foot {
  margin: 20px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.8;
}

/* ---------------------------------------------------------------- layout */
.shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(231, 235, 243, .9);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #f2f4f7;
  border-radius: 11px;
}

.main-nav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background .18s, color .18s, box-shadow .18s;
}

.main-nav-btn:hover { color: var(--ink); }

.main-nav-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: 6px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #d8e8ff;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: 12.5px; font-weight: 650; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { font-size: 10px; color: var(--muted-2); margin-top: 2px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  transition: color .18s, border-color .18s, background .18s, transform .18s;
}

.icon-btn svg { width: 17px; height: 17px; }

.icon-btn:hover { color: var(--primary); border-color: #c8dcff; background: #f8fbff; }
.icon-btn:active { transform: scale(.94); }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 28px 64px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0 0 7px;
  font-size: 31px;
  letter-spacing: -.035em;
  font-weight: 750;
}

.page-sub {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 17px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #2e8bff, var(--primary));
  box-shadow: 0 8px 20px -8px rgba(22, 119, 255, .65), inset 0 1px 0 rgba(255, 255, 255, .24);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #1c7dff, var(--primary-deep));
  box-shadow: 0 10px 24px -8px rgba(22, 119, 255, .7);
}

.btn-ghost {
  color: #475467;
  background: var(--surface);
  border-color: var(--line);
}

.btn-ghost:hover { color: var(--primary); border-color: #c8dcff; background: #f8fbff; }

.btn-danger {
  color: #b42318;
  background: var(--danger-soft);
  border-color: #fbd3d0;
}

.btn-danger:hover { background: #fee4e2; border-color: #f9b8b2; }

.btn-gray {
  color: #fff;
  background: #98a2b3;
  border-color: #98a2b3;
  box-shadow: 0 4px 10px -6px rgba(52, 64, 84, .5);
}

.btn-gray:hover { background: #7f8b9d; border-color: #7f8b9d; color: #fff; }

.btn-success {
  color: #fff;
  background: #12b76a;
  border-color: #12b76a;
  box-shadow: 0 6px 16px -8px rgba(18, 183, 106, .6);
}

.btn-success:hover { background: #039855; border-color: #039855; }

.btn-red {
  color: #fff;
  background: #f04438;
  border-color: #f04438;
  box-shadow: 0 6px 16px -8px rgba(240, 68, 56, .55);
}

.btn-red:hover { background: #d92d20; border-color: #d92d20; }

.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 9px; }
.btn-lg { height: 48px; font-size: 14px; border-radius: 12px; }
.btn-block { width: 100%; padding: 12px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.text-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 7px;
}

.text-btn:hover { color: var(--primary); background: var(--primary-soft); }

/* ---------------------------------------------------------------- status tabs */
.status-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.status-tab {
  flex: 0 0 auto;
  border: 1px solid #e3e8f1;
  background: var(--surface);
  color: #344054;
  border-radius: 999px;
  padding: 11px 21px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
  transition: background .18s, color .18s, border-color .18s, box-shadow .18s;
}

.status-tab span { color: var(--muted-2); font-weight: 500; }
.status-tab b { font-weight: 600; }

.status-tab:hover { border-color: #c8d9f3; color: var(--primary); }

.status-tab.active {
  color: #fff;
  background: linear-gradient(180deg, #2f86ff, var(--primary));
  border-color: transparent;
  box-shadow: 0 10px 22px -10px rgba(22, 119, 255, .8);
}

.status-tab.active span { color: rgba(255, 255, 255, .72); }

/* ---------------------------------------------------------------- filter */
.filter-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-box svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted-2);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border: 1px solid #dde3ec;
  border-radius: 10px;
  background: #fbfcfe;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

.search-box input:focus,
.date-wrap input:focus {
  border-color: #8ebbff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22, 119, 255, .1);
}

.search-box input::placeholder { color: #b3bcc9; }

.date-wrap {
  flex: 0 0 206px;
}

.date-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #dde3ec;
  border-radius: 10px;
  background: #fbfcfe;
  color: #475467;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.date-wrap input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }

.date-sep { font-size: 12px; color: var(--muted-2); flex: 0 0 auto; }

.search-btn { flex: 0 0 auto; height: 42px; padding: 0 22px; }

/* ---------------------------------------------------------------- table */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.records-bar {
  position: relative;
  padding: 14px 22px;
  background: #f9fafc;
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
  font-size: 12.5px;
  color: #475467;
  font-variant-numeric: tabular-nums;
}

.scroll-hint {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10.5px;
  color: var(--muted-2);
  background: #f9fafc;
  padding-left: 8px;
}

.batch-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  animation: rise .22s ease both;
}

.batch-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.batch-selected {
  font-size: 16px;
  font-weight: 700;
  color: #079455;
  letter-spacing: -.01em;
}

.batch-selected b { color: #079455; font-weight: 750; }

.batch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.batch-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: #344054;
}

.batch-input-row { display: flex; gap: 10px; }

.batch-input-row input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 1px solid #dde3ec;
  border-radius: 10px;
  background: #fbfcfe;
  padding: 0 13px;
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

.batch-input-row input:focus {
  border-color: #8ebbff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22, 119, 255, .1);
}

.batch-input-row input::placeholder { color: #b3bcc9; }

.batch-input-row .btn {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 20px;
  border-radius: 10px;
}

.batch-extra {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed #eef2f7;
  font-size: 11px;
  color: var(--muted-2);
}

.batch-extra > span { margin-right: 6px; }
.batch-extra .text-btn { font-size: 11.5px; }

.text-btn.danger { color: var(--danger); }
.text-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }

.table-scroll { overflow-x: auto; }

table { border-collapse: collapse; }

.link-table {
  width: 100%;
  min-width: 1080px;
  table-layout: fixed;
}

.link-table th,
.link-table td {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.link-table th:last-child,
.link-table td:last-child { border-right: 0; }
.link-table tbody tr:last-child td { border-bottom: 0; }

.link-table thead th {
  height: 56px;
  background: #f7f9fc;
  color: #475467;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
  padding: 0 10px;
}

.check-col { width: 86px; }
.url-col { width: auto; }
.pin-col { width: 116px; }
.quota-col { width: 124px; }
.remark-col { width: 176px; }
.action-col { width: 116px; }
.clicks-col { width: 176px; }

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.link-table tbody td {
  height: 76px;
  padding: 10px 12px;
  text-align: center;
  vertical-align: middle;
  font-size: 12.5px;
  color: #344054;
  background: #fff;
}

.link-table tbody tr { transition: background .15s; }
.link-table tbody tr:hover td { background: #fafcff; }

.link-table tbody tr.is-current td { background: #f7fbff; }

.url-cell { text-align: left !important; padding-left: 22px !important; }

.url-block { min-width: 0; }

.url-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.backup-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 5px;
  padding-left: 1px;
}

.backup-tag {
  flex: 0 0 auto;
  font-size: 9.5px;
  font-weight: 600;
  color: #dc6803;
  background: var(--warning-soft);
  border: 1px solid #fdecc8;
  border-radius: 5px;
  padding: 1px 5px;
}

.backup-url {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
}

.link-url {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  color: #667085;
  text-decoration: none;
  transition: color .15s;
}

a.link-url:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

.live-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #d6e6ff;
  border-radius: 999px;
  padding: 2px 7px 2px 6px;
}

.live-tag i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, .13);
}

.chip-btn {
  border: 0;
  height: 32px;
  min-width: 72px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--warning);
  transition: background .16s, transform .16s;
}

.chip-btn:hover { background: #e79918; }
.chip-btn:active { transform: scale(.97); }
.chip-btn.is-on { background: var(--warning-deep); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04); }
.chip-btn.is-on:hover { background: #c25b02; }

.muted-dash { color: #d0d5dd; }

.quota-input {
  width: 78px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #e2e7ef;
  border-radius: 8px;
  background: #fff;
  color: #344054;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}

.quota-input:hover { border-color: #c8d9f3; }
.quota-input:focus { border-color: #8ebbff; box-shadow: 0 0 0 3px rgba(22, 119, 255, .1); }
.quota-input:disabled { background: #f8fafc; color: var(--muted-2); }

.remark-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: #344054;
  font-size: 12.5px;
  padding: 4px 6px;
  border-radius: 7px;
  transition: color .15s, background .15s;
}

.remark-edit span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remark-edit svg {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  opacity: .38;
  transition: opacity .15s;
}

.remark-edit:hover { color: var(--primary); background: var(--primary-soft); }
.remark-edit:hover svg { opacity: .8; }

.remark-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.remark-empty { color: #b3bcc9; }

.state-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 9.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 7px;
  color: #667085;
  background: #f2f4f7;
}

.state-tag.offline { color: #dc6803; background: var(--warning-soft); }
.state-tag.done { color: #039855; background: var(--success-soft); }

.mini-btn {
  border: 0;
  height: 32px;
  min-width: 64px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  transition: background .16s, transform .16s, opacity .16s;
}

.mini-btn:hover { transform: translateY(-1px); }
.mini-btn:active { transform: translateY(0); }
.mini-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.mini-btn.red { background: #f04438; }
.mini-btn.red:hover { background: #d92d20; }
.mini-btn.blue { background: var(--primary); }
.mini-btn.blue:hover { background: var(--primary-deep); }
.mini-btn.ghost {
  color: #475467;
  background: #fff;
  border: 1px solid #dde3ec;
}
.mini-btn.ghost:hover { color: var(--primary); border-color: #bcd6fb; background: #f8fbff; }

.clicks-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.click-number {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 16px;
  text-align: right;
}

.table-head-btn {
  border: 0;
  height: 30px;
  min-width: 56px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f04438;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  transition: background .16s;
}

.table-head-btn:hover { background: #d92d20; }
.table-head-btn:disabled { opacity: .35; cursor: not-allowed; }

.action-head-text { font-size: 13px; font-weight: 650; color: #475467; }

.table-empty {
  text-align: center !important;
  color: var(--muted-2) !important;
  font-size: 12.5px !important;
  padding: 46px 20px !important;
  height: auto !important;
  background: #fff !important;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  background: #fbfcfe;
}

.page-summary {
  font-size: 12px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.pager { display: flex; align-items: center; gap: 6px; }

.pager-btn,
.page-num {
  height: 32px;
  min-width: 32px;
  padding: 0 10px;
  border: 1px solid #e3e8f1;
  border-radius: 8px;
  background: #fff;
  color: #475467;
  font-size: 12px;
  font-weight: 500;
  transition: color .15s, border-color .15s, background .15s;
}

.pager-btn:hover:not(:disabled),
.page-num:hover { color: var(--primary); border-color: #bcd6fb; background: #f8fbff; }

.pager-btn:disabled { opacity: .45; cursor: not-allowed; }

.page-num.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}

.page-num.ellipsis {
  border: 0;
  background: transparent;
  min-width: 18px;
  padding: 0;
  color: var(--muted-2);
  cursor: default;
}

.page-numbers { display: flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- accounts */
.accounts-panel { padding: 0; }

.accounts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--line-soft);
}

.accounts-head h2 { margin: 0 0 5px; font-size: 17px; letter-spacing: -.02em; }
.accounts-head p { margin: 0; font-size: 12px; color: var(--muted); }

.account-table { width: 100%; min-width: 780px; }

.account-table th {
  height: 50px;
  padding: 0 20px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line-soft);
  color: #475467;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}

.account-table td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: #475467;
  vertical-align: middle;
}

.account-table tbody tr:last-child td { border-bottom: 0; }
.account-table tbody tr:hover td { background: #fbfcfe; }

.account-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
}

.account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #dbe9ff;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 9px;
}

.state-pill.on { color: #039855; background: var(--success-soft); }
.state-pill.off { color: #667085; background: #f2f4f7; }
.state-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.row-link-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 8px;
  border-radius: 6px;
}

.row-link-btn:hover { background: var(--primary-soft); }
.row-link-btn.danger { color: var(--danger); }
.row-link-btn.danger:hover { background: var(--danger-soft); }

.mono { font-family: var(--mono); font-size: 11.5px; }

/* ---------------------------------------------------------------- visits */
.visits-panel .page-head { margin-bottom: 20px; }

.visit-table { width: 100%; min-width: 960px; }

.visit-table th {
  height: 50px;
  padding: 0 20px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line-soft);
  color: #667085;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-align: left;
  white-space: nowrap;
}

.visit-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  color: #475467;
  vertical-align: middle;
}

.visit-table tbody tr:last-child td { border-bottom: 0; }
.visit-table tbody tr:hover td { background: #fbfcfe; }

.visit-url {
  display: block;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.visit-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-weight: 600;
}

.fallback-tag {
  font-size: 9px;
  color: #dc6803;
  background: var(--warning-soft);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 500;
}

.device {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  color: var(--muted-2);
  font-size: 11px;
}

.no-wrap { white-space: nowrap; }

/* ---------------------------------------------------------------- modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 40, .42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fade .18s ease both;
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 20px;
  padding: 26px 28px 24px;
  box-shadow: 0 40px 100px -30px rgba(16, 24, 40, .55);
  animation: pop .24s cubic-bezier(.2, .8, .2, 1) both;
}

.modal-wide { max-width: 680px; }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
}

.modal-head h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.025em;
}

.modal-head .eyebrow { margin-bottom: 5px; }

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.modal-spacer { flex: 1; }

/* ---------------------------------------------------------------- forms */
.field { display: block; margin-bottom: 16px; }

.field > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #344054;
  margin-bottom: 7px;
}

.field > span em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted-2);
  font-size: 11px;
  margin-left: 2px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input:not([type]) {
  width: 100%;
  height: 43px;
  border: 1px solid #dde3ec;
  border-radius: 10px;
  padding: 0 13px;
  font-size: 13.5px;
  color: var(--ink);
  background: #fbfcfe;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

input:hover { border-color: #cdd6e3; }

input:focus {
  border-color: #8ebbff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22, 119, 255, .11);
}

input::placeholder { color: #b3bcc9; }
input:disabled { background: #f7f9fc; color: var(--muted); cursor: not-allowed; }

.quota-row { display: flex; align-items: center; gap: 12px; }
.quota-row input { width: 150px; flex: 0 0 auto; }
.quota-row span { font-size: 11.5px; color: var(--muted-2); }

.form-error {
  min-height: 17px;
  margin: 0 0 4px;
  font-size: 11.5px;
  color: var(--danger);
  line-height: 1.5;
}

.hint {
  margin: 11px 0 0;
  font-size: 11px;
  line-height: 1.75;
  color: var(--muted-2);
}

.batch-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #344054;
  line-height: 1.6;
  margin-bottom: 10px;
}

.batch-textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: 14px 15px;
  border: 1px solid #dde3ec;
  border-radius: 12px;
  background: #fbfcfe;
  color: #344054;
  font-size: 12.5px;
  line-height: 1.75;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

.batch-textarea:focus {
  border-color: #8ebbff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22, 119, 255, .1);
}

.batch-textarea::placeholder { color: #b3bcc9; }

.batch-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 2px 14px;
  font-size: 11px;
  color: var(--muted-2);
}

.batch-hint {
  margin: 8px 2px 0;
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted-2);
}

.batch-errors {
  margin-bottom: 14px;
  border: 1px solid #fbd3d0;
  background: #fffafa;
  border-radius: 10px;
  padding: 11px 14px;
  max-height: 160px;
  overflow-y: auto;
  font-size: 11.5px;
  line-height: 1.7;
  color: #b42318;
}

.batch-errors strong { display: block; margin-bottom: 4px; font-size: 12px; }
.batch-errors ul { margin: 0; padding-left: 18px; }

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #344054;
  cursor: pointer;
  user-select: none;
}

.switch-row input { position: absolute; opacity: 0; pointer-events: none; }

.switch-visual {
  width: 36px;
  height: 21px;
  border-radius: 999px;
  background: #d0d5dd;
  position: relative;
  transition: background .18s;
}

.switch-visual::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .18);
  transition: transform .18s;
}

.switch-row input:checked + .switch-visual { background: var(--primary); }
.switch-row input:checked + .switch-visual::after { transform: translateX(15px); }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 16px);
  z-index: 120;
  padding: 10px 18px;
  border-radius: 10px;
  background: #101828;
  color: #fff;
  font-size: 12.5px;
  box-shadow: 0 18px 40px -12px rgba(16, 24, 40, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  max-width: min(86vw, 520px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #b42318; }

/* ---------------------------------------------------------------- animations */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .filter-card { flex-wrap: wrap; }
  .search-box { flex: 1 1 100%; }
  .date-wrap { flex: 1 1 220px; }
  .search-btn { flex: 0 0 auto; }
}

@media (max-width: 900px) {
  .topbar-inner {
    height: auto;
    padding: 12px 20px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .brand { min-width: 0; }
  .brand-text span { display: none; }
  .main-nav { order: 3; width: 100%; }
  .main-nav-btn { flex: 1; }
  .user-meta { display: none; }
  .container { padding: 26px 20px 56px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 27px; }
  .date-sep { display: none; }
  .batch-grid { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 700px) {
  .page-head { flex-direction: column; gap: 16px; margin-bottom: 20px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .status-tab { padding: 10px 16px; font-size: 13px; }
  .filter-card { padding: 12px; gap: 10px; }
  .search-box { min-width: 0; }
  .date-wrap { flex: 1 1 100%; }
  .search-btn { flex: 1; }
  .records-bar { padding: 12px 16px; font-size: 12px; }
  .batch-panel { padding: 16px; }
  .batch-panel-head { flex-wrap: wrap; }
  .batch-selected { font-size: 15px; }
  .batch-input-row { flex-direction: column; }
  .batch-input-row .btn { width: 100%; }
  .batch-extra { flex-wrap: wrap; }
  .table-footer { flex-direction: column; align-items: stretch; gap: 10px; }
  .pager { justify-content: center; flex-wrap: wrap; }
  .page-summary { text-align: center; }
  .accounts-head { flex-direction: column; align-items: flex-start; }
  .accounts-head .btn { width: 100%; }
  .modal { padding: 22px; border-radius: 17px; }
  .modal-backdrop { padding: 14px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; }
  .modal-actions .modal-spacer { display: none; }
}

@media (max-width: 520px) {
  .auth-card { padding: 30px 24px 24px; border-radius: 20px; }
  .container { padding: 22px 14px 48px; }
  .topbar-inner { padding: 10px 14px; }
  .page-head h1 { font-size: 24px; }
  .user-chip { display: none; }
  .status-tabs { gap: 8px; }
  .quota-row { flex-direction: column; align-items: flex-start; }
  .quota-row input { width: 100%; }
}
