/* =========================================================
   Панель управления сайтом «Алиса Матухно»
   ========================================================= */

:root {
  --ink: #1b1613;
  --ink-2: #2b2320;
  --muted: #7d6f64;
  --cream: #faf7f3;
  --line: #e3d9cc;
  --gold: #b18b5a;
  --gold-deep: #8d6c40;
  --gold-soft: #f6efe4;
  --white: #fff;
  --ok: #2f7d55;
  --err: #c25b4a;
  --sans: "Manrope", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --sidebar: 250px;
}

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--cream);
}

a { color: var(--gold-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; color: var(--ink); font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Вход ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--ink);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  padding: 40px;
  border-radius: 4px;
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
}
.login-card__logo {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-deep);
  font-family: Georgia, serif;
  font-size: 1.1rem;
}
.login-card h1 { text-align: center; font-size: 1.3rem; }
.login-card .sub { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 26px; }

/* ---------- Каркас ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: none;
  background: var(--ink);
  color: #cfc4b7;
  padding: 26px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 18px;
}
.sidebar__mark {
  width: 40px; height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, serif;
}
.sidebar__name { color: #fff; font-size: .95rem; font-weight: 600; line-height: 1.2; }
.sidebar__role { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }

.sidebar__group {
  padding: 18px 24px 8px;
  font-size: .64rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #7c6f63;
}
.sidebar a.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: #cfc4b7;
  font-size: .9rem;
  border-left: 2px solid transparent;
  transition: all .2s;
}
.sidebar a.nav-link:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.sidebar a.nav-link.is-active {
  background: rgba(177,139,90,.16);
  border-left-color: var(--gold);
  color: #fff;
}
.sidebar svg { width: 18px; height: 18px; flex: none; }
.sidebar .count {
  margin-left: auto;
  background: var(--gold);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
}

.main { flex: 1; min-width: 0; }

.topbar-admin {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-admin__user { font-size: .88rem; color: var(--muted); }
.content { padding: 28px; max-width: 1240px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- Карточки ---------- */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 22px;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.panel--flush { padding: 0; overflow: hidden; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 20px 22px;
}
.stat__num { font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.stat__label { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data thead th {
  background: #f4efe8;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
table.data tbody tr:hover { background: #fbf8f4; }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- Значки ---------- */
.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge--new  { background: #fdf1dc; color: #8a6209; }
.badge--ok   { background: #e2f1e8; color: #2f7d55; }
.badge--done { background: #e8e8ec; color: #4d4d5c; }
.badge--off  { background: #fbe6e3; color: #a5402f; }
.badge--muted{ background: #eee9e2; color: #7d6f64; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: .84rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  text-decoration: none !important;
}
.btn--primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--primary:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.btn--gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn--gold:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--danger { background: transparent; color: var(--err); border-color: #f0cfc9; }
.btn--danger:hover { background: var(--err); color: #fff; border-color: var(--err); }
.btn--sm { padding: 6px 13px; font-size: .78rem; }
.btn--full { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Формы ---------- */
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: .78rem; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea {
  font-family: inherit;
  font-size: .95rem;
  color: var(--ink);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fdfbf8;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
}
.field .hint { font-size: .78rem; color: var(--muted); }
.field .err { font-size: .78rem; color: var(--err); }
.check { display: flex; align-items: center; gap: 9px; font-size: .9rem; }
.check input { width: 17px; height: 17px; accent-color: var(--gold-deep); }

/* ---------- Сообщения ---------- */
.alert {
  padding: 13px 18px;
  border-radius: 3px;
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  margin-bottom: 20px;
  font-size: .92rem;
}
.alert--ok  { border-color: var(--ok);  background: #e9f4ee; color: #23603f; }
.alert--err { border-color: var(--err); background: #fbeceb; color: #8c3a2c; }

/* ---------- Фильтры ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .chip {
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: .8rem;
  color: var(--muted);
  background: var(--white);
}
.filters .chip:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.filters .chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Сетка работ ---------- */
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.work-tile { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--white); }
.work-tile img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.work-tile__body { padding: 12px 14px; }
.work-tile__title { font-size: .84rem; line-height: 1.4; margin-bottom: 8px; }
.work-tile__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; padding: 16px 0; }
  .sidebar__brand { padding-bottom: 16px; margin-bottom: 10px; }
  .sidebar a.nav-link { padding: 10px 20px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 20px 16px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .btn { width: 100%; }
}
