/* ====== DosAuto-inspired theme ====== */
:root {
  --brand: #c8102e;          /* основной красный (лого dosauto) */
  --brand-dark: #8b0a1f;     /* тёмный акцент */
  --brand-ink: #1a1a1a;      /* основной текст */
  --brand-muted: #6b7280;    /* вторичный текст */
  --bg: #ffffff;             /* фон страницы */
  --bg-soft: #f6f6f8;        /* секции/карточки */
  --line: #e5e7eb;           /* границы */
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0,0,0,.06);
  --container: 1100px;
  --font: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--brand-ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ====== Header ====== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px; /* расстояние между навигацией и аватаркой */
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .5px; font-size: 20px; }
.brand__mark {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  overflow: hidden;
}
.brand__logo {
  width: 100%;
  height: 100%;
  object-fit: fill;
  padding: 10%;
  display: block;
}
.brand small { display: block; font-weight: 500; color: var(--brand-muted); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.nav a { color: var(--brand-ink); margin-left: 18px; font-weight: 500; }
.nav a:hover { color: var(--brand); text-decoration: none; }

/* ====== Hero ====== */
.hero {
  background: linear-gradient(135deg, #fff 0%, #fff 50%, rgba(200,16,46,.06) 100%);
  padding: 56px 20px 40px;
  border-bottom: 1px solid var(--line);
}
.hero__inner { max-width: var(--container); margin: 0 auto; }
.hero h1 { font-size: 38px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -.5px; }
.hero h1 span { color: var(--brand); }
.hero p { font-size: 17px; color: var(--brand-muted); max-width: 720px; margin: 0; }

/* ====== Container ====== */
.container { max-width: var(--container); margin: 0 auto; padding: 32px 20px 64px; }

/* ====== Form card ====== */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.block {
  border-top: 1px dashed var(--line);
  padding-top: 24px;
  margin-top: 24px;
}
.block:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.block__title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--brand);
  margin: 0 0 16px;
}
.block__title::before {
  content: ''; width: 4px; height: 18px; background: var(--brand); border-radius: 2px;
}
.block__hint { color: var(--brand-muted); font-size: 13px; margin: -8px 0 16px; }

.grid { display: grid; gap: 14px 18px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px;
}
.field .req { color: var(--brand); margin-left: 2px; }
.field input,
.field textarea,
.field select,
.field__control {
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  box-sizing: border-box;
}

/* единый вид для всех контролов, включая select */
.field__control--select,
.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, #9ca3af 50%, transparent 50%),
    linear-gradient(135deg, transparent 50%, #9ca3af 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px; /* место под стрелку */
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.field__control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(200,16,46,.12);
}

.field__control--error {
  border-color: var(--err);
}

.field textarea,
.field__control--textarea {
  min-height: 90px;
  resize: vertical;
}
.field small { color: var(--brand-muted); font-size: 12px; margin-top: 4px; }

/* ====== Submit ====== */
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 28px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: 0; border-radius: 8px;
  padding: 12px 22px; font: inherit; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .05s;
  text-decoration: none;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: #fff; color: var(--brand-ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--bg-soft); }
.btn--sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert--ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert--err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert--warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ====== Success page ====== */
.success {
  text-align: center; padding: 48px 24px;
}
.success .check {
  width: 72px; height: 72px; border-radius: 50%;
  background: #ecfdf5; color: var(--ok);
  display: grid; place-items: center; margin: 0 auto 18px;
  font-size: 36px; font-weight: 900;
}

/* ====== Footer ====== */
.site-footer {
  background: #111; color: #d1d5db; padding: 32px 20px; margin-top: 48px;
}
.site-footer__inner { max-width: var(--container); margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.site-footer a { color: #fff; }

/* ====== Profile ====== */

.profile {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 10px;
}

.profile__avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile__tooltip {
  position: absolute;
  right: 0;
  top: 120%;
  transform: translateY(6px);
  background: #ffffff;
  color: var(--brand-ink);
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 14px;
  min-width: 170px;
  box-shadow: 0 4px 16px rgba(15,23,42,.12);
  border: 1px solid var(--line);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s, transform .12s;
  z-index: 100;
}

.profile__name {
  font-weight: 600;
  margin-bottom: 2px;
}

.profile__role {
  color: var(--brand-muted);
  font-size: 11px;
  margin-bottom: 6px;
}

.profile__actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.profile__action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 12px;
  color: var(--brand-ink);
  padding: 4px 0;
  border-radius: 6px;
  padding-inline: 4px;
  text-decoration: none;
}

.profile__action:hover {
  background: var(--bg-soft);
  color: var(--brand);
  text-decoration: none;
}

.profile__action--danger:hover {
  color: var(--err);
}

.profile:hover .profile__tooltip,
.profile__tooltip:hover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ====== Admin ====== */
.login {
  max-width: 380px; margin: 80px auto; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow);
}
.login h1 { margin: 0 0 6px; font-size: 22px; }
.login p { color: var(--brand-muted); font-size: 14px; margin: 0 0 20px; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar input[type="search"] {
  font: inherit; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; min-width: 260px;
}
.toolbar .pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-soft); padding: 6px 10px; border-radius: 999px; font-size: 13px;
}
.toolbar .pill b { color: var(--brand); }

.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: top; }
.table th { background: var(--bg-soft); font-weight: 600; color: #374151; font-size: 12px; letter-spacing: .5px; text-transform: uppercase; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafafa; }
.table .payload { max-width: 480px; max-height: 120px; overflow: auto; }
.table code { font-size: 12px; color: var(--brand-muted); }

.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status--sent { background: #ecfdf5; color: #065f46; }
.status--pending { background: #fffbeb; color: #92400e; }
.status--error { background: #fef2f2; color: #991b1b; }

.pagination { display: flex; gap: 6px; align-items: center; margin-top: 16px; }
.pagination a, .pagination span {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px;
  text-decoration: none; color: var(--brand-ink);
}
.pagination a:hover { background: var(--bg-soft); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled { color: var(--brand-muted); }
