:root {
  /* Фирменные цвета колледжа метростроя — приглушённая бирюза, мягче для глаз */
  --navy: #1c818b;        /* основной */
  --navy-dark: #16686f;   /* ховер */
  --navy-deep: #114f55;   /* глубокий: заголовки, футер, градиент */
  --teal: #2e8a92;        /* акцент */
  --red: #c34747;
  --bg: #f4f6f6;
  --card: #fff;
  --line: #e2e8e9;
  --text: #1e2c2e;
  --muted: #64777a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(17, 79, 85, .06), 0 4px 14px rgba(17, 79, 85, .05);
}

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

body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--navy); }

.site-header {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  color: #fff;
  padding: 18px 0;
}

.site-header .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.brand {
  display: flex; align-items: center; gap: 16px;
  color: inherit; text-decoration: none; border-radius: var(--radius);
  padding: 4px 8px; margin: -4px -8px; transition: background .12s;
}
.brand:hover { background: rgba(255, 255, 255, .12); }

.site-nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.site-nav a {
  color: #fff; text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius); opacity: .92;
  transition: background .12s, opacity .12s;
}
.site-nav a:hover { background: rgba(255, 255, 255, .16); opacity: 1; }

.admin-btn {
  text-decoration: none; font-size: 13px; padding: 8px 14px;
  background: rgba(255, 255, 255, .15);
}
.admin-btn:hover { background: rgba(255, 255, 255, .26); }

.site-header h1 { font-size: 19px; font-weight: 600; letter-spacing: .2px; }
.site-header p { font-size: 13px; opacity: .78; }
.site-header .spacer { margin-left: auto; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.crumbs { font-size: 13px; color: var(--muted); padding: 16px 0 4px; }
.crumbs a { text-decoration: underline; text-underline-offset: 2px; }
.crumbs a:hover { color: var(--teal); }

.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 14px 0 2px; padding: 9px 16px 9px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--navy); font-size: 14px; font-weight: 600; text-decoration: none;
  box-shadow: var(--shadow); transition: .12s;
}
.back-link:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.back-link span { font-size: 17px; line-height: 1; }

main.wrap { padding-bottom: 56px; }

h2.page-title { font-size: 24px; font-weight: 700; margin: 10px 0 4px; color: var(--navy-deep); }
.subtitle { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.info {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 18px 0 24px;
}
.info-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  border-left: 4px solid var(--teal); padding: 14px 16px; box-shadow: var(--shadow);
}
.info-item b { display: block; color: var(--navy-deep); font-size: 14px; margin-bottom: 4px; }
.info-item p { font-size: 14px; color: var(--text); }
.info-item p b { display: inline; font-size: inherit; color: var(--navy); }

.section-title {
  font-size: 17px; color: var(--navy-deep); margin: 26px 0 12px;
  border-left: 4px solid var(--teal); padding-left: 10px;
}

.grid-sites { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.site-card { display: flex; flex-direction: column; gap: 6px; }
.site-card-name { font-size: 18px; font-weight: 700; color: var(--navy-deep); }
.site-card-addr { font-size: 13px; color: var(--muted); }
.site-card .meta { margin-top: 2px; }
.site-card-go { margin-top: auto; padding-top: 10px; color: var(--teal); font-weight: 600; font-size: 14px; }
.site-card:hover .site-card-go { color: var(--navy); }

.search-bar { display: flex; gap: 8px; margin: 18px 0 24px; }
.search-bar input {
  flex: 1; min-width: 0;
  padding: 12px 14px; font-size: 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card);
}
.search-bar input:focus { outline: 2px solid var(--navy); outline-offset: -1px; border-color: var(--navy); }

button, .btn {
  font: inherit; cursor: pointer;
  border: 0; border-radius: var(--radius);
  padding: 12px 18px;
  background: var(--navy); color: #fff; font-weight: 600;
}
button:hover, .btn:hover { background: var(--navy-dark); }
button.ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
button.ghost:hover { background: #eef1f9; }
button.danger { background: var(--red); }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card {
  background: var(--card);
  border: 1.5px solid #bcccce;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

a.card { text-decoration: none; color: inherit; display: block; transition: transform .12s, box-shadow .12s, border-color .12s; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(17, 79, 85, .14); border-color: var(--navy); }

.card .code { font-size: 12px; font-weight: 700; color: var(--teal); letter-spacing: .4px; }
.card .name { font-size: 16px; font-weight: 600; margin: 4px 0 8px; }
.card .meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }

.site-block { margin-bottom: 28px; }
.site-block > h3 {
  font-size: 17px; color: var(--navy-deep); margin-bottom: 2px;
  border-left: 4px solid var(--teal); padding-left: 10px;
}
.site-block > .addr { font-size: 13px; color: var(--muted); margin: 0 0 12px 14px; }

.filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 16px 0; padding: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  align-items: center;
}
.filters label { font-size: 13px; color: var(--muted); }
.filters select, .filters input[type="search"] {
  font: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.chip {
  font-size: 13px; padding: 7px 12px; border-radius: 20px;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  cursor: pointer; user-select: none;
}
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

.stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.stats b { color: var(--navy-deep); font-size: 15px; }

table.rating { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.rating th {
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 600;
  text-align: left; padding: 14px 12px; white-space: nowrap;
}
table.rating td { padding: 13px 12px; border-top: 1px solid var(--line); font-size: 14px; }
table.rating tbody tr:last-child td { padding-bottom: 15px; }
table.rating tbody tr:nth-child(even) { background: #fafbff; }
table.rating tbody tr.hit td { background: #d7f5e2 !important; box-shadow: inset 0 2px 0 #1a9d5a, inset 0 -2px 0 #1a9d5a; }
table.rating tbody tr.hit td:first-child { box-shadow: inset 0 2px 0 #1a9d5a, inset 0 -2px 0 #1a9d5a, inset 2px 0 0 #1a9d5a; }
table.rating tbody tr.hit td:last-child { box-shadow: inset 0 2px 0 #1a9d5a, inset 0 -2px 0 #1a9d5a, inset -2px 0 0 #1a9d5a; }
table.rating tbody tr.over-seats td { color: var(--muted); }
table.rating td.rank { font-weight: 700; color: var(--navy-deep); width: 48px; }
table.rating td.code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-weight: 600; }
table.rating td.score { font-weight: 700; }

.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.tag.orig { background: #e3f5ee; color: #0a7048; }
.tag.copy { background: #eef1f9; color: var(--muted); }
.tag.spb { background: #e7edff; color: var(--navy); }
.tag.svo { background: #ffe9e9; color: var(--red); }
.tag.gos { background: #e6f5f5; color: var(--teal); }
.tag.oge { background: #eef1f9; color: var(--muted); }
.tag.oge-strong { background: #fff3d6; color: #8a5a00; }

.seats-line td { padding: 0; }
.seats-line .bar {
  background: var(--teal); color: #fff; font-size: 12px; font-weight: 600;
  padding: 5px 10px; letter-spacing: .3px;
}

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

.cards-mobile { display: none; }

.result-row { border-bottom: 1px solid var(--line); padding: 12px 0; }
.result-row:last-child { border: 0; }

footer { background: var(--navy-deep); color: rgba(255,255,255,.7); font-size: 13px; padding: 28px 0; margin-top: 24px; }
footer a { color: #fff; }

@media (max-width: 720px) {
  .site-header h1 { font-size: 16px; }
  table.rating { display: none; }
  .cards-mobile { display: grid; gap: 10px; }
  .a-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center;
    box-shadow: var(--shadow);
  }
  .a-card.hit { background: #d7f5e2; outline: 2px solid #1a9d5a; }
  .a-card .rk { font-size: 20px; font-weight: 800; color: var(--navy-deep); grid-row: span 2; min-width: 34px; }
  .a-card .cd { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 15px; }
  .a-card .sc { font-size: 19px; font-weight: 800; color: var(--navy); grid-row: span 2; }
  .a-card .tags { grid-column: 2; display: flex; gap: 5px; flex-wrap: wrap; }
  .cutoff-note { background: var(--teal); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 6px; }
  .filters { position: sticky; top: 0; z-index: 5; }
}
