*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.topnav {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: .6rem 1.5rem;
  display: flex;
  gap: 1.25rem;
  font-size: .9rem;
}
.topnav a { color: #4b5563; text-decoration: none; }
.topnav a:hover { color: #2563eb; }

main {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  width: 100%;
  max-width: 660px;
  margin-top: 4rem;
}

main.wide { max-width: 860px; margin-top: 2rem; }

h1 { margin-bottom: 1.5rem; font-size: 1.4rem; color: #111; }
h2 { font-size: 1.1rem; color: #111; }

form { display: flex; gap: .5rem; }

input[type="url"] {
  flex: 1;
  padding: .5rem .75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 1rem;
}
input[type="url"]:focus { outline: 2px solid #2563eb; border-color: transparent; }

button {
  padding: .5rem 1.1rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  white-space: nowrap;
}
button:hover { background: #1d4ed8; }

#result {
  margin-top: 1rem;
  padding: .75rem;
  border-radius: 4px;
  word-break: break-all;
  font-size: .95rem;
}
#result.ok    { background: #eff6ff; color: #1e40af; }
#result.error { background: #fef2f2; color: #b91c1c; }
#result.hidden, .hidden { display: none; }
#result a { color: inherit; font-weight: 600; }

.subtitle { color: #6b7280; margin-bottom: 1.5rem; }

.obs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.obs-card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, border-color .15s;
}
.obs-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); border-color: #2563eb; }

.obs-icon  { font-size: 1.8rem; margin-bottom: .5rem; }
.obs-title { font-size: 1.05rem; font-weight: 600; color: #111; margin-bottom: .35rem; }
.obs-desc  { font-size: .875rem; color: #4b5563; margin-bottom: .75rem; line-height: 1.5; }
.obs-url   { font-size: .8rem; color: #2563eb; word-break: break-all; }

.obs-hints { margin-top: 2rem; }
.obs-hints h2 { margin-bottom: .75rem; }

.hint-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.hint-table th { text-align: left; padding: .5rem .75rem; background: #f9fafb; border-bottom: 2px solid #e5e7eb; }
.hint-table td { padding: .5rem .75rem; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
.hint-table td:first-child { width: 55%; }
.hint-table code { background: #f3f4f6; padding: .1em .35em; border-radius: 3px; font-size: .82rem; word-break: break-all; }

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; }
.field label { font-size: .9rem; font-weight: 500; color: #374151; }
.field input {
  padding: .5rem .75rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 1rem;
}
.field input:focus { outline: 2px solid #2563eb; border-color: transparent; }

body.admin-body {
  align-items: stretch;
  background: #f3f4f6;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e293b;
  color: #f1f5f9;
  padding: .75rem 1.5rem;
  font-size: .95rem;
}
.admin-header-title { font-weight: 600; }
.admin-header-nav { display: flex; gap: 1rem; align-items: center; }
.admin-header-nav a { color: #cbd5e1; text-decoration: none; font-size: .9rem; }
.admin-header-nav a:hover { color: #fff; }

.btn-ghost-sm {
  padding: .3rem .8rem;
  border: 1px solid #475569;
  border-radius: 4px;
  color: #cbd5e1 !important;
  font-size: .85rem;
}
.btn-ghost-sm:hover { background: #334155; }

.admin-main {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-num   { font-size: 2rem; font-weight: 700; color: #1e293b; line-height: 1.1; }
.stat-label { font-size: .8rem; color: #6b7280; margin-top: .2rem; }

.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.action-card {
  background: #fff;
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.action-card h3 { font-size: .95rem; margin-bottom: .4rem; }
.action-card p  { font-size: .82rem; color: #6b7280; margin-bottom: .75rem; line-height: 1.45; }
.action-card code { background: #f3f4f6; padding: .1em .3em; border-radius: 3px; font-size: .8rem; }

.action-form { display: flex; gap: .5rem; align-items: center; }
.num-input {
  width: 72px;
  padding: .38rem .5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: .9rem;
  text-align: center;
}

.btn-danger  { background: #dc2626 !important; }
.btn-danger:hover  { background: #b91c1c !important; }
.btn-warning { background: #d97706 !important; }
.btn-warning:hover { background: #b45309 !important; }
.btn-sm { padding: .28rem .65rem !important; font-size: .82rem !important; }

.alert {
  padding: .7rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error   { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }

.table-wrap { overflow-x: auto; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

.links-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: .875rem;
}
.links-table thead { background: #f8fafc; }
.links-table th {
  text-align: left;
  padding: .65rem .85rem;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
.links-table td {
  padding: .6rem .85rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.links-table tbody tr:hover { background: #f8fafc; }
.links-table tbody tr:last-child td { border-bottom: none; }

.row-fake { background: #fffbeb; }
.row-fake:hover { background: #fef9c3 !important; }

.url-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4b5563;
}
.code-link { font-family: monospace; font-weight: 600; color: #2563eb; text-decoration: none; }
.code-link:hover { text-decoration: underline; }
.mono { font-family: monospace; font-size: .82rem; color: #4b5563; }

.badge {
  display: inline-block;
  padding: .15em .55em;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-fake { background: #fef3c7; color: #92400e; }
.badge-real { background: #d1fae5; color: #065f46; }

.empty-row { text-align: center; color: #9ca3af; padding: 2rem; }
