:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #6a6a6a;
  --line: #e5e5e0;
  --accent: #111111;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --red: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  --font: Inter, system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 246, 243, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 20px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 0.95rem; letter-spacing: -0.03em;
}
.brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft);
}
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a {
  padding: 8px 14px; border-radius: 9px;
  font-size: 0.8125rem; font-weight: 500; color: var(--muted);
}
.nav a:hover { color: var(--ink); }
.nav a.active {
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.main {
  flex: 1; width: 100%; max-width: 1080px;
  margin: 0 auto; padding: 28px 20px 56px;
}
.page-title {
  font-size: 1.6rem; font-weight: 700;
  letter-spacing: -0.035em; margin-bottom: 6px;
}
.page-lead { color: var(--muted); font-size: 0.95rem; margin-bottom: 28px; max-width: 42rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.stat-card .label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
}
.stat-card .value {
  margin-top: 8px; font-size: 1.85rem; font-weight: 700; letter-spacing: -0.04em;
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-hd {
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-hd strong { font-size: 0.875rem; font-weight: 600; }
.card-bd { padding: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 9px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { opacity: 0.92; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-blue { background: var(--blue); border-color: var(--blue); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.input, .select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--bg); font-size: 0.9rem; outline: none;
}
.input:focus, .select:focus { border-color: var(--ink); background: #fff; }
.search-row { display: flex; gap: 8px; flex: 1; min-width: 220px; flex-wrap: wrap; }
.search-row .input { flex: 1; min-width: 160px; }
.search-row .select { width: auto; min-width: 140px; }
.results { display: flex; flex-direction: column; gap: 8px; }
.res {
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); cursor: pointer; display: block;
}
.res:hover { border-color: #cfcfc8; background: #fff; box-shadow: var(--shadow); }
.res .nm { font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.res .sub { margin-top: 5px; font-size: 0.8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.badge {
  display: inline-flex; padding: 2px 9px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; background: var(--blue-soft); color: var(--blue);
}
.badge.tanta { background: var(--green-soft); color: var(--green); }
.meta { font-size: 0.8125rem; color: var(--muted); margin-bottom: 12px; }
.empty, .loading { text-align: center; padding: 40px 16px; color: var(--muted); font-size: 0.9rem; }
.site-footer {
  border-top: 1px solid var(--line); padding: 16px 20px;
  text-align: center; font-size: 0.75rem; color: var(--muted);
}
.dl { display: grid; gap: 12px; }
.dl-row { display: grid; grid-template-columns: 140px 1fr; gap: 10px; font-size: 0.875rem; }
.dl-row dt { color: var(--muted); font-weight: 500; }
.dl-row dd { font-weight: 550; word-break: break-word; }
.hint { font-size: 0.8125rem; color: var(--muted); margin-top: 12px; }
.quick-grid { display: grid; gap: 14px; }
.photo-box {
  border: 1px dashed var(--line); border-radius: 12px; padding: 18px;
  background: var(--bg); text-align: center;
}
.photo-box p { font-size: 0.85rem; color: var(--muted); margin-bottom: 12px; }
.photo-box img { max-width: 160px; max-height: 200px; margin: 12px auto 0; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.card-preview { width: 100%; border-radius: 12px; border: 1px solid var(--line); margin-top: 14px; }
.err { color: var(--red); font-size: 0.8125rem; margin-top: 10px; min-height: 1.2em; }
.layout { display: grid; gap: 16px; }
@media (min-width: 720px) { .quick-grid { grid-template-columns: 1.2fr 1fr; } }
@media (min-width: 800px) { .layout { grid-template-columns: 1.1fr 0.9fr; } }
@media (max-width: 640px) {
  .nav a { padding: 8px 10px; font-size: 0.75rem; }
  .dl-row { grid-template-columns: 1fr; gap: 2px; }
}
