/* admin.css — Links, Stats and Sign-in views. */

.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: 20px 20px 60px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 640px) { .page { padding: 14px 14px 60px; } }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; }
.page-head .sub { font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); }
.page-head .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-shell { width: 280px; max-width: 100%; height: 36px; }

/* ----- Table ----- */
.table-card { overflow: hidden; }
.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.t thead th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); white-space: nowrap; }
.t tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: none; }
.t tbody tr:hover td { background: var(--surface-2); }
.t .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.t .code-cell { display: inline-flex; align-items: center; gap: 6px; }
.t .code-cell .code { font-family: var(--font-mono); color: var(--accent); font-weight: 500; }
.t .code-cell .copy { opacity: 0; }
.t tr:hover .code-cell .copy, .t .code-cell .copy:focus-visible { opacity: 1; }
.t .dest { max-width: 420px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.t .date { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-mute); white-space: nowrap; }
.t .actions { text-align: right; white-space: nowrap; }
.t .actions .btn { margin-left: 4px; }
.t .actions .label { display: none; }
.kind-pill { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-mute); border: 1px solid var(--border-2); }
.kind-pill.url { color: var(--accent); background: var(--accent-bg); border-color: var(--accent-bg-2); }
.t .anon { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 11.5px; color: var(--text-mute); flex-wrap: wrap; }
.pagination .btns { display: flex; gap: 6px; }

@media (max-width: 760px) {
  .t thead { display: none; }
  .t, .t tbody, .t tr, .t td { display: block; }
  .t tr { padding: 12px 14px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr; gap: 6px; }
  .t tbody tr:hover td { background: transparent; }
  .t tbody td { padding: 0; border: none; }
  .t td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 72px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-right: 8px; }
  .t .dest { max-width: 100%; white-space: normal; word-break: break-all; display: inline; }
  .t .actions { text-align: left; padding-top: 4px; }
  .t .actions .btn { margin: 0 4px 0 0; }
  .t .code-cell .copy { opacity: 1; }
  .t .num { text-align: left; }
}

/* ----- Stats ----- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 860px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
.metric { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.metric .label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.metric .value { font-family: var(--font-mono); font-size: 26px; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; }
.metric .delta { font-size: 12px; color: var(--text-mute); }
.chart-card .card-body { padding: 12px 18px 18px; }
.chart-legend { display: flex; gap: 16px; font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font-mono); font-size: 10px; fill: var(--text-faint); }
.chart .grid { stroke: var(--border-2); }
.chart .bar-clicks { fill: var(--accent); }
.chart .bar-misses { fill: var(--text-faint); opacity: 0.55; }
.chart .hit:hover .bar-clicks { fill: var(--accent-soft); }
.stats-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .stats-cols { grid-template-columns: 1fr; } }
.rank { display: flex; flex-direction: column; gap: 10px; }
.rank-row { display: grid; grid-template-columns: 64px 1fr 48px; align-items: center; gap: 10px; }
.rank-row .k { font-family: var(--font-mono); font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.rank-row .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.rank-row .n { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-mute); text-align: right; font-variant-numeric: tabular-nums; }

/* ----- Auth ----- */
.auth { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 380px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-fill); color: var(--accent-fill-text); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 18px; }
.auth-brand h1 { font-size: 18px; }
.auth-brand p { font-size: 12.5px; color: var(--text-mute); }
.auth-error { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; background: var(--err-bg); border: 1px solid var(--err-border); color: var(--err); font-size: 13px; }
.auth-foot { font-size: 12px; color: var(--text-faint); text-align: center; }
.pw-shell { position: relative; }
.pw-shell input { padding-right: 44px; }
.pw-shell .btn { position: absolute; right: 4px; top: 4px; height: 30px; width: 34px; }

/* Chart tooltip + table view */
.chart-tip { position: absolute; z-index: 5; pointer-events: none; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; font-family: var(--font-mono); font-size: 11px; color: var(--text); background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px; box-shadow: var(--shadow-2); white-space: nowrap; }
.chart-tip b { color: var(--text-strong); font-weight: 600; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.chart-tip i.c { background: var(--accent); }
.chart-tip i.m { background: var(--text-faint); opacity: 0.6; }
.chart .hit { outline: none; }
.chart .hit:focus-visible rect:first-child { fill: var(--accent-bg); }
.chart-table { margin-top: 12px; }
.chart-table summary { cursor: pointer; font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 0; }
.chart-table summary:hover { color: var(--text-strong); }
.chart-table .t { margin-top: 8px; max-width: 420px; }
