/* l.alexera.pro — minimal admin UI. Stripe/Linear vibe, no Tailwind. */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #0066cc;
  --accent-hover: #0052a3;
  --accent-soft: #e6f0fb;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 1px rgba(0,0,0,0.02);
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

code, pre, .mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

pre {
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0;
}

.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.inline-form { display: inline; margin: 0; }

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.brand {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 14px; }

/* Containers */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px;
}

.breadcrumb {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.api-hint pre { font-size: 12px; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 8px; }
.form label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 6px;
}
.form input,
.form-inline input {
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}
.form input:focus,
.form-inline input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.form-inline .grow { flex: 1 1 240px; min-width: 240px; }

/* Buttons */
.btn-primary, .btn-danger {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #fbcfcf; }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
  font-family: inherit;
}
.link-btn:hover { text-decoration: underline; }

/* Alerts */
.alert {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.alert.ok { background: var(--success-soft); border-color: rgba(22,163,74,.25); color: #14532d; }
.alert.error { background: var(--danger-soft); border-color: rgba(220,38,38,.25); color: #7f1d1d; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table th {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-strong);
}
.table tr:last-child td { border-bottom: none; }
.table .slug { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 500; }
.target { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ua, .ref { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { text-align: right; }

/* Login */
.login-shell {
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card { width: 360px; max-width: 100%; }
.login-title { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.login-sub { margin: 0 0 18px; font-size: 13px; }

/* Link detail */
.link-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}
.stat-big { text-align: right; }
.stat-value {
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.meta { display: grid; grid-template-columns: 120px 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; word-break: break-all; }

.chart-wrap { position: relative; height: 240px; }

/* Mobile */
@media (max-width: 640px) {
  .container { padding: 16px; }
  .nav { padding: 12px 16px; }
  .link-head { flex-direction: column; align-items: flex-start; }
  .stat-big { text-align: left; }
  .meta { grid-template-columns: 1fr; }
  .meta dt { margin-top: 6px; }
  .target { max-width: 200px; }
}
