/* oral-bilim — проверка дипломов и сертификатов
   Палитра взята из логотипа: изумрудный #154E54, золотистый #B38449 */

:root {
  --teal: #154e54;
  --teal-d: #0e3a3f;
  --teal-h: #1b6168;
  --teal-l: #e7f0f0;
  --gold: #b38449;
  --gold-d: #8a6230;
  --gold-l: #f6eee2;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --text: #172426;
  --muted: #5d6b6c;
  --line: #e0e6e4;
  --line-2: #eef2f1;
  --danger: #b0412e;
  --danger-l: #fbeeeb;
  --warn: #8f6312;
  --warn-l: #fbf3e3;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 42, 45, .05), 0 4px 16px rgba(16, 42, 45, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-h); text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.icon { flex: none; vertical-align: middle; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px;
  font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap;
  background: var(--surface); color: var(--text); transition: background .15s, border-color .15s, color .15s;
  text-decoration: none !important;
}
.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-h); color: #fff; }
.btn--gold { background: var(--gold); color: #fff; }
.btn--gold:hover { background: var(--gold-d); color: #fff; }
.btn--ghost { border-color: var(--line); background: var(--surface); color: var(--text); }
.btn--ghost:hover { border-color: #c9d3d1; background: #f8faf9; color: var(--text); }
.btn--danger { border-color: #ecc9c1; color: var(--danger); background: var(--surface); }
.btn--danger:hover { background: var(--danger-l); color: var(--danger); }
.btn--lg { height: 52px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn--sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn--icon { width: 32px; padding: 0; }
.btn:focus-visible, .input:focus-visible, .lang__item:focus-visible { outline: 3px solid rgba(179, 132, 73, .45); outline-offset: 1px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------- Язык ---------- */
.lang { display: inline-flex; padding: 3px; background: var(--line-2); border-radius: 10px; }
.lang__item { padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lang__item:hover { color: var(--teal); text-decoration: none; }
.lang__item.is-active { background: var(--surface); color: var(--teal); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.lang--sm .lang__item { padding: 3px 8px; font-size: 12px; }

/* =========================================================
   ПУБЛИЧНАЯ ЧАСТЬ
   ========================================================= */
.public { display: flex; flex-direction: column; min-height: 100vh; }
.pub-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.pub-head__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; max-width: 1080px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand__mark { width: 40px; height: 40px; }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__text strong { font-size: 15px; line-height: 1.25; color: var(--teal); }
.brand__text small { font-size: 12.5px; color: var(--muted); line-height: 1.3; }

.pub-main { flex: 1; padding-bottom: 56px; }
.hero { text-align: center; padding-top: 64px; padding-bottom: 8px; }
.hero__title { font-size: clamp(26px, 4.4vw, 36px); font-weight: 700; letter-spacing: -.01em; color: var(--teal-d); }
.hero__title::after { content: ""; display: block; width: 48px; height: 3px; border-radius: 2px; background: var(--gold); margin: 18px auto 0; }
.hero__sub { margin: 16px auto 32px; max-width: 560px; color: var(--muted); font-size: 16px; }
.hero__hint { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

.search {
  display: flex; gap: 8px; padding: 6px; max-width: 560px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.search:focus-within { border-color: #b9cbc9; }
.search__field { flex: 1; display: flex; align-items: center; min-width: 0; }
.search__prefix { padding: 0 4px 0 14px; color: var(--gold); font-weight: 700; font-size: 18px; }
.search__input {
  flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: transparent;
  font: 600 20px/1 var(--font); color: var(--text); letter-spacing: .02em; padding: 0 8px;
}
.search__input::placeholder { color: #9aa7a7; font-weight: 400; font-size: 17px; letter-spacing: 0; }

.result-wrap { margin-top: 28px; }
.result { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.result__head { display: flex; gap: 14px; align-items: flex-start; padding: 20px 24px; }
.result__head h2 { font-size: 18px; }
.result__head p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.result--found .result__head { background: var(--teal-l); color: var(--teal); border-bottom: 1px solid #d6e5e4; }
.result--revoked .result__head { background: var(--danger-l); color: var(--danger); border-bottom: 1px solid #f1d5cf; }
.result--notfound .result__head { background: var(--warn-l); color: var(--warn); }
.result__head h2 { color: inherit; }
.result__body { padding: 22px 24px 8px; }
.result__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13.5px; color: var(--muted); }
.result__type { font-weight: 700; color: var(--gold-d); letter-spacing: .02em; text-transform: uppercase; font-size: 12.5px; }
.result__date { display: inline-flex; align-items: center; gap: 6px; }
.result__name { margin: 10px 0 0; font-size: 24px; font-weight: 700; line-height: 1.3; color: var(--text); }
.result__award { margin: 12px 0 0; }
.result__event { margin: 14px 0 0; color: var(--text); font-size: 15px; }
.result__actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 24px 20px; border-top: 1px solid var(--line-2); margin-top: 14px; }

.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 18px 0 0; }
.dl__item { padding: 12px 0; border-top: 1px solid var(--line-2); min-width: 0; }
.dl__item--wide { grid-column: 1 / -1; }
.dl dt { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.dl dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }

.pub-foot { border-top: 1px solid var(--line); background: var(--surface); }
.pub-foot__in { display: flex; gap: 12px; align-items: center; padding-top: 20px; padding-bottom: 20px; max-width: 1080px; }
.pub-foot p { margin: 0; font-size: 13px; color: var(--muted); }
.pub-foot span { font-size: 12px; }
.pub-foot .credit { margin-left: auto; align-self: flex-end; white-space: nowrap; }
.credit { font-size: 12px; color: #8a9798; letter-spacing: .02em; }
.admin-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.auth__credit { text-align: center; margin: 14px 0 0; }

/* ---------- Бейджи ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--muted); }
.badge--lg { padding: 6px 12px; font-size: 14px; }
.badge--winner { background: var(--gold); color: #fff; }
.badge--prizewinner { background: var(--gold-l); color: var(--gold-d); }
.badge--participant { background: var(--teal-l); color: var(--teal); }
.badge--revoked { background: var(--danger-l); color: var(--danger); }
.badge--ok { background: var(--teal-l); color: var(--teal); }
.badge--no { background: var(--warn-l); color: var(--warn); }

/* =========================================================
   ПАНЕЛЬ УПРАВЛЕНИЯ
   ========================================================= */
.admin { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 40;
  display: flex; flex-direction: column; background: var(--teal-d); color: #dfeceb;
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.side__brand:hover { text-decoration: none; color: #fff; }
.side__brand img { background: #fff; border-radius: 9px; padding: 3px; }
.side__brand span { display: flex; flex-direction: column; font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.side__brand small { font-weight: 400; color: #a9c4c2; font-size: 12px; margin-top: 2px; }
.side__nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.side__foot { padding: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side__foot form { margin: 0; }
.side__link {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 9px; border: 0; background: none; color: #cfe0df;
  font: 500 14px/1.3 var(--font); cursor: pointer; text-align: left;
}
.side__link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.side__link.is-active { background: rgba(255, 255, 255, .11); color: #fff; }
.side__link.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.side__link .icon { opacity: .9; }

.main { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 0 24px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar__menu { display: none; border: 0; background: none; padding: 6px; margin-left: -6px; color: var(--text); cursor: pointer; }
.topbar__title { font-size: 18px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__right { display: flex; align-items: center; gap: 14px; }
.topbar__user { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.content { padding: 24px; flex: 1; max-width: 1280px; width: 100%; }
.side-backdrop { display: none; }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16, 42, 45, .04); }
.card + .card, .grid + .card, .card + .grid, .toolbar + .card { margin-top: 20px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card__head h2 { font-size: 15.5px; font-weight: 700; }
.card__body { padding: 20px; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: 20px; }
.grid > .card, .grid > form.card { margin-top: 0; }
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--3-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat__label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.stat__label .icon { color: var(--gold); }
.stat__value { margin-top: 6px; font-size: 28px; font-weight: 700; color: var(--teal-d); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__note { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.table th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: #fafbfb; white-space: nowrap; }
.table tbody tr:hover { background: #fafcfb; }
.table tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.table .sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.table .chk { width: 36px; }
.table .acts { white-space: nowrap; text-align: right; width: 1%; }
.table .acts form { display: inline; }
.table--compact th, .table--compact td { padding: 8px 12px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- Формы ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field label, .label { font-size: 13px; font-weight: 600; color: #34494b; }
.field .req { color: var(--danger); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid #d3dcda; border-radius: 9px;
  background: #fff; font: 14.5px/1.4 var(--font); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; }
.select { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235d6b6c' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(21, 78, 84, .12); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--teal); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 6px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toolbar__group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(150px, 1fr)) auto; gap: 10px; padding: 14px; }
.filters .btns { display: flex; gap: 8px; }
.count-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; color: var(--muted); }

/* ---------- Сообщения ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert .icon { margin-top: 1px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert--ok { background: var(--teal-l); color: var(--teal-d); border-color: #d1e2e1; }
.alert--error { background: var(--danger-l); color: #8e3424; border-color: #f0d3cc; }
.alert--warn { background: var(--warn-l); color: #77520f; border-color: #f0e0bd; }
.alert--info { background: #f2f5f5; color: #3c5052; border-color: var(--line); }

/* ---------- Пагинация ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 4px; padding: 14px 16px; border-top: 1px solid var(--line-2); }
.pager__item { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 14px; color: var(--text); border: 1px solid var(--line); background: #fff; }
.pager__item:hover { text-decoration: none; border-color: #c9d3d1; color: var(--teal); }
.pager__item.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }
.pager__item.is-disabled { color: #b9c3c2; }
.pager__gap { padding: 0 4px; align-self: center; color: var(--muted); }

/* ---------- Вход ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.auth__box { width: 100%; max-width: 380px; }
.auth__logo { display: block; width: 116px; margin: 0 auto 18px; }
.auth__title { text-align: center; font-size: 15px; font-weight: 600; color: var(--teal-d); margin-bottom: 4px; }
.auth__sub { text-align: center; font-size: 13px; color: var(--muted); margin: 0 0 22px; }
.auth .card__body { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.auth__lang { display: flex; justify-content: center; margin-top: 18px; }

/* ---------- Мелочи ---------- */
.mapping { display: flex; flex-wrap: wrap; gap: 6px; }
.mapping span { font-size: 12.5px; padding: 3px 8px; border-radius: 6px; background: var(--line-2); }
.mapping b { color: var(--teal); font-weight: 600; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kv > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; }
.kv strong { display: block; font-size: 24px; color: var(--teal-d); }
.kv span { font-size: 13px; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.errors-box { max-height: 220px; overflow: auto; font-size: 13px; }
.mt-0 { margin-top: 0; }

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .btns { grid-column: 1 / -1; }
  .grid--3-1 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; }
  .side.is-open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  .side-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(10, 30, 32, .35); }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .topbar__menu { display: inline-flex; }
  .topbar__user { display: none; }
  .content { padding: 16px; }
  .admin-foot { padding: 12px 16px; }
  .grid--2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero { padding-top: 40px; }
  .search { flex-direction: column; padding: 8px; }
  .search__btn { width: 100%; }
  .brand__text small { display: none; }
  .pub-foot__in { display: grid; grid-template-columns: 28px 1fr; gap: 6px 12px; align-items: start; }
  .pub-foot .credit { grid-column: 2; margin-left: 0; }
  .brand__text strong { font-size: 14px; }
  .dl { grid-template-columns: 1fr; }
  .result__head, .result__body, .result__actions { padding-left: 18px; padding-right: 18px; }
  .result__name { font-size: 21px; }
  .form-grid, .filters, .kv { grid-template-columns: 1fr; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat__value { font-size: 23px; }
  .table th, .table td { padding: 10px; }
  .hide-sm { display: none; }
}

/* ---------- Печать ---------- */
@media print {
  body { background: #fff; }
  .pub-head .lang, .search, .hero__sub, .hero__hint, .no-print, .pub-foot { display: none !important; }
  .hero { padding-top: 0; }
  .result, .result__head { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
