﻿/* ==========================================================================
   components.css вЂ” РєРѕРјРїРѕРЅРµРЅС‚С‹ РґРёР·Р°Р№РЅ-СЃРёСЃС‚РµРјС‹.
   Р—Р°РІРёСЃРёС‚ РѕС‚ tokens.css Рё base.css. РҐР°СЂРґРєРѕРґ С†РІРµС‚РѕРІ/С€СЂРёС„С‚РѕРІ РЅРµ РґРѕРїСѓСЃРєР°РµС‚СЃСЏ.
   ========================================================================== */

/* ---------- 7.1 РЈС‚РёР»РёС‚Р°СЂРЅР°СЏ РїРѕР»РѕСЃР° -------------------------------------- */

.topbar {
  height: var(--header-top);
  background: var(--color-brown-deep);
  color: rgba(255, 255, 255, 0.8);
  font: 400 12px/1 var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}
.topbar__nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.topbar a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.topbar a:hover {
  color: #fff;
  text-decoration: underline;
}
.topbar .icon {
  width: 16px;
  height: 16px;
}
.topbar__user {
  margin-left: auto;
}

/* ---------- 7.2 РЁР°РїРєР° ---------------------------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--color-header);
  border-bottom: 1px solid var(--color-line);
}
.header.is-stuck {
  box-shadow: var(--shadow-sticky);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--header-main);
}
.header__logo {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  padding: 8px 12px;
  background: var(--color-surface);
  border-radius: 8px;
}
.header__logo img {
  display: block;
  width: auto;
  height: 40px;
}
.header__nav {
  display: flex;
  gap: 28px;
}
.header__nav a {
  padding: 25px 0;
  color: var(--color-text);
  font: 400 15px/22px var(--font-body);
  text-decoration: none;
  white-space: nowrap;
}
.header__nav a:hover {
  color: var(--color-brand);
}
.header__nav a[aria-current="page"] {
  color: var(--color-brown);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--color-brand);
}
.header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

/* РџРѕРёСЃРє */
.search {
  position: relative;
  display: flex;
  align-items: center;
  width: 280px;
  max-width: 100%;
}
.search__input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font: 400 14px/20px var(--font-body);
}
.search__input::placeholder {
  color: var(--color-text-muted);
}
.search__input:focus {
  outline: none;
  border-color: var(--color-action);
  box-shadow: 0 0 0 3px rgba(178, 58, 42, 0.15);
}
.search__btn {
  position: absolute;
  right: 4px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--color-text-muted);
}
.search__btn:hover {
  color: var(--color-brand);
}

/* РџРѕР»СЊР·РѕРІР°С‚РµР»СЊ */
.user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  font: 400 14px/20px var(--font-body);
  text-decoration: none;
}
.user__name {
  white-space: nowrap;
}
.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-beige-deep);
  color: var(--color-brown);
  font: 700 12px/1 var(--font-body);
  text-transform: uppercase;
}

/* ---------- 7.3 РЎР°Р№РґР±Р°СЂ -------------------------------------------------- */

.sidebar {
  padding: 16px 0 24px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-line);
}
.sidebar__group {
  margin: 24px 16px 8px;
  color: var(--color-text-muted);
  font: 400 12px/16px var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidebar__group:first-child {
  margin-top: 0;
}
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 16px;
  border-left: 3px solid transparent;
  color: var(--color-text);
  font: 400 15px/22px var(--font-body);
  text-decoration: none;
}
.sidebar__item:hover {
  background: var(--color-beige);
}
.sidebar__item.is-active {
  border-left-color: var(--color-brand);
  background: var(--color-beige);
  color: var(--color-brown);
  font-weight: 700;
}
.sidebar__item .icon {
  color: var(--color-text-secondary);
}
.sidebar__item.is-active .icon {
  color: var(--color-brand);
}
.sidebar__count {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-beige-deep);
  color: var(--color-brown);
  font-size: 12px;
  font-weight: 700;
}

/* ---------- 7.4 РҐР»РµР±РЅС‹Рµ РєСЂРѕС€РєРё ------------------------------------------ */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--color-text-muted);
  font: 400 13px/19px var(--font-body);
}
.breadcrumbs a {
  color: inherit;
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: var(--color-brand);
}
.breadcrumbs [aria-current="page"] {
  color: var(--color-text-secondary);
}

/* ---------- 7.6 РљРЅРѕРїРєРё --------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-text);
  font: 700 16px/22px var(--font-body);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--color-line);
  border-color: var(--color-line);
  color: var(--color-text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--primary {
  background: var(--color-action);
  color: var(--color-on-action);
}
.btn--primary:hover:not(:disabled) {
  background: var(--color-action-hover);
}
.btn--primary:active:not(:disabled) {
  background: var(--color-action-press);
  transform: translateY(1px);
}

.btn--secondary {
  background: var(--color-surface);
  border-color: var(--color-line);
  color: var(--color-brown);
}
.btn--secondary:hover:not(:disabled) {
  border-color: var(--color-beige-line);
  background: var(--color-beige);
}

.btn--ghost {
  background: transparent;
  color: var(--color-brand);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--color-brand-tint);
}

.btn--danger {
  background: var(--color-danger-tint);
  border-color: #e7c3be;
  color: var(--color-danger);
}
.btn--danger:hover:not(:disabled) {
  background: #f7dcd8;
}

.btn--dark {
  background: var(--color-brown-deep);
  color: var(--color-on-action);
}
.btn--dark:hover:not(:disabled) {
  background: #3e3128;
}

.btn--sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn--lg { height: 52px; padding: 0 28px; }
.btn--block { width: 100%; }

.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
}

.btn-group {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- 7.8 РџРѕР»СЏ ----------------------------------------------------- */

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field__label {
  color: var(--color-text);
  font: 400 14px/20px var(--font-body);
}
.field__label .req {
  color: var(--color-brand);
}
.field__hint {
  color: var(--color-text-muted);
  font: 400 13px/19px var(--font-body);
}
.field__error {
  display: none;
  color: var(--color-danger);
  font: 400 13px/19px var(--font-body);
}
.field.is-invalid .field__error {
  display: block;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font: 400 16px/25px var(--font-body);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--color-text-muted);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--color-action);
  box-shadow: 0 0 0 3px rgba(178, 58, 42, 0.15);
}
.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--color-beige);
  color: var(--color-text-muted);
  cursor: not-allowed;
}
.textarea {
  min-height: 112px;
  padding: 12px 14px;
  resize: vertical;
}
.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e5a50' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"],
.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea {
  border-color: var(--color-danger);
}
.input[aria-invalid="true"]:focus,
.field.is-invalid .input:focus {
  box-shadow: 0 0 0 3px rgba(166, 27, 18, 0.15);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Р§РµРєР±РѕРєСЃ, СЂР°РґРёРѕ, РїРµСЂРµРєР»СЋС‡Р°С‚РµР»СЊ */
.check,
.radio,
.switch {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--color-text);
  font: 400 15px/22px var(--font-body);
  cursor: pointer;
}
.check input,
.radio input,
.switch input {
  appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1.5px solid #c9b7ab;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.check input::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
}
.check input:checked {
  background: var(--color-action);
  border-color: var(--color-action);
}
.check input:checked::after {
  opacity: 1;
}
.radio input {
  border-radius: 50%;
}
.radio input::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
}
.radio input:checked {
  background: var(--color-action);
  border-color: var(--color-action);
}
.radio input:checked::after {
  opacity: 1;
}
.switch input {
  width: 44px;
  height: 24px;
  margin-top: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-beige-deep);
  position: relative;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--dur) var(--ease);
}
.switch input:checked {
  background: var(--color-action);
}
.switch input:checked::after {
  transform: translateX(20px);
}
.check input:focus-visible,
.radio input:focus-visible,
.switch input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ---------- 7.10 Р¤РёР»СЊС‚СЂС‹ Рё С‡РёРїС‹ ---------------------------------------- */

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: end;
  gap: 12px;
  margin-bottom: 32px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--color-beige);
}
.filters__actions {
  display: flex;
  gap: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font: 400 13px/18px var(--font-body);
}
.chip button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--color-text-muted);
}
.chip button:hover {
  background: var(--color-beige);
  color: var(--color-text);
}
.chip .icon {
  width: 12px;
  height: 12px;
}

/* ---------- 7.11 РўР°Р±С‹ Рё СЃРµРіРјРµРЅС‚С‹ --------------------------------------- */

.tabs {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--color-line);
}
.tab {
  position: relative;
  padding: 12px 0;
  border: 0;
  background: none;
  color: var(--color-text-secondary);
  font: 400 15px/22px var(--font-body);
  white-space: nowrap;
}
.tab:hover {
  color: var(--color-brown);
}
.tab[aria-selected="true"] {
  color: var(--color-brown);
  font-weight: 700;
}
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--color-brand);
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--color-beige);
}
.segmented__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--color-text-secondary);
  font: 400 14px/20px var(--font-body);
}
.segmented__item[aria-selected="true"] {
  background: var(--color-action);
  color: var(--color-on-action);
}

/* ---------- 7.12 РљР°СЂС‚РѕС‡РєРё ----------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card--hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.card__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--color-beige);
}
.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}
.card__meta {
  margin: 0 0 8px;
  color: var(--color-text-muted);
  font: 400 13px/19px var(--font-body);
}
.card__title {
  margin: 0 0 8px;
  color: var(--color-brown);
  font: 700 19px/26px var(--font-display);
}
.card__text {
  margin: 0 0 16px;
  color: var(--color-text-secondary);
  font: 400 14px/21px var(--font-body);
}
.card__link {
  margin-top: auto;
  color: var(--color-brand);
  font: 400 14px/21px var(--font-body);
  text-decoration: none;
}
.card__link:hover {
  text-decoration: underline;
}

.card--service {
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.card--service:hover {
  border-color: var(--color-brand);
  box-shadow: var(--shadow-card);
}
.card--service .card__body {
  padding: 20px;
}
.card--service .card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: var(--color-brand-tint);
  color: var(--color-brand);
}
.card--accent {
  background: var(--color-action);
  color: var(--color-on-action);
  border-radius: var(--radius-xl);
}
.card--accent .card__title,
.card--accent .card__text,
.card--accent .card__meta {
  color: inherit;
}
.card--accent .card__link,
.card--dark .card__link {
  color: inherit;
  text-decoration: underline;
}
.card--dark {
  background: var(--color-brown-deep);
  color: var(--color-on-action);
}
.card--dark .card__title,
.card--dark .card__text {
  color: inherit;
}

.kpi {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}
.kpi__value {
  margin: 0 0 4px;
  color: var(--color-brown);
  font: 800 30px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}
.kpi__label {
  margin: 0;
  color: var(--color-text-secondary);
  font: 400 12px/16px var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.choice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.choice:hover {
  border-color: var(--color-brand);
  box-shadow: var(--shadow-card);
}
.choice__title {
  margin: 0;
  color: var(--color-brown);
  font: 700 18px/24px var(--font-display);
}
.choice__text {
  margin: 2px 0 0;
  color: var(--color-text-secondary);
  font: 400 14px/21px var(--font-body);
}
.choice .icon {
  margin-left: auto;
  color: var(--color-text-muted);
  transition: transform var(--dur-fast) var(--ease);
}
.choice:hover .icon {
  color: var(--color-brand);
  transform: translateX(4px);
}

/* ---------- 7.13 РўР°Р±Р»РёС†С‹ ------------------------------------------------ */

.table-wrap {
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--color-line);
}
.table-toolbar__group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.table-toolbar .search {
  width: 280px;
}
.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
}
.table th {
  height: 44px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-line);
  background: var(--color-beige);
  color: var(--color-text-secondary);
  font: 400 12px/16px var(--font-body);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.table th[aria-sort="ascending"]::after {
  content: " в†‘";
  color: var(--color-brand);
}
.table th[aria-sort="descending"]::after {
  content: " в†“";
  color: var(--color-brand);
}
.table td {
  height: var(--row-comfort);
  padding: 12px 16px;
  border-top: 1px solid var(--color-line-soft);
  color: var(--color-text);
  font: 400 14px/20px var(--font-body);
  vertical-align: middle;
}
.table tbody tr:hover {
  background: #fbf7f3;
}
.table tbody tr[aria-selected="true"] {
  background: var(--color-brand-tint);
}
.table tbody tr[aria-selected="true"] td:first-child {
  box-shadow: inset 2px 0 0 var(--color-brand);
}
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Р§РµРєР±РѕРєСЃС‹ РІРЅСѓС‚СЂРё С‚Р°Р±Р»РёС†С‹ вЂ” С‚РѕС‚ Р¶Рµ РІРёРґ, С‡С‚Рѕ РІ С„РѕСЂРјР°С… */
.table input[type="checkbox"] {
  appearance: none;
  display: grid;
  place-content: center;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid #c9b7ab;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
}
.table input[type="checkbox"]::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
}
.table input[type="checkbox"]:checked {
  border-color: var(--color-action);
  background: var(--color-action);
}
.table input[type="checkbox"]:checked::after {
  opacity: 1;
}
.table input[type="checkbox"]:indeterminate {
  border-color: var(--color-action);
  background: var(--color-action);
}
.table input[type="checkbox"]:indeterminate::after {
  width: 10px;
  height: 2px;
  border: 0;
  background: #fff;
  transform: none;
  opacity: 1;
}
.table input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.table__check {
  width: 44px;
  padding-right: 0;
}
.table__actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}
.table--compact td {
  height: var(--row-compact);
  font-size: 13px;
  line-height: 18px;
}
.table--compact th {
  height: 40px;
}

.bulkbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  margin-bottom: 12px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: var(--color-brown-deep);
  color: var(--color-on-action);
  font: 400 14px/20px var(--font-body);
}
.bulkbar strong {
  font-weight: 700;
}
.bulkbar__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.bulkbar .btn--ghost {
  color: var(--color-on-action);
}
.bulkbar .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- 7.14 Р‘РµР№РґР¶Рё ------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font: 400 12px/16px var(--font-body);
  white-space: nowrap;
}
.badge--success { background: var(--color-success-tint); color: var(--color-success-text); }
.badge--info { background: var(--color-info-tint); color: var(--color-info); }
.badge--warning { background: var(--color-warning-tint); color: var(--color-warning-text); }
.badge--danger { background: var(--color-danger-tint); color: var(--color-danger); }
.badge--neutral { background: var(--color-beige); color: var(--color-brown); }
.badge--muted { background: #f1ede9; color: #7a6a60; }

/* ---------- 7.15 РЈРІРµРґРѕРјР»РµРЅРёСЏ ------------------------------------------- */

.alert {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-left: 4px solid var(--color-info);
  border-radius: var(--radius-md);
  background: var(--color-info-tint);
  color: var(--color-text);
}
.alert__icon {
  flex-shrink: 0;
  color: var(--color-info);
}
.alert__title {
  margin: 0 0 4px;
  color: var(--color-text);
  font: 700 15px/21px var(--font-body);
}
.alert__text {
  margin: 0;
  color: var(--color-text-secondary);
  font: 400 14px/21px var(--font-body);
}
.alert--success { border-color: var(--color-success); background: var(--color-success-tint); }
.alert--success .alert__icon { color: var(--color-success-text); }
.alert--warning { border-color: var(--color-warning); background: var(--color-warning-tint); }
.alert--warning .alert__icon { color: var(--color-warning-text); }
.alert--danger { border-color: var(--color-danger); background: var(--color-danger-tint); }
.alert--danger .alert__icon { color: var(--color-danger); }

/* ---------- 7.16 РњРѕРґР°Р»СЊРЅС‹Рµ РѕРєРЅР° Рё РїР°РЅРµР»Рё ------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(61, 46, 39, 0.5);
}
.modal {
  width: 560px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-modal);
}
.modal--sm { width: 440px; }
.modal__head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 24px 12px;
}
.modal__title {
  margin: 0;
  color: var(--color-brown);
  font: 700 19px/26px var(--font-display);
}
.modal__close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -8px -8px 0 auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-text-muted);
}
.modal__close:hover {
  background: var(--color-beige);
  color: var(--color-text);
}
.modal__body {
  padding: 0 24px 20px;
  color: var(--color-text-secondary);
  font: 400 15px/23px var(--font-body);
}
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 24px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  background: rgba(61, 46, 39, 0.4);
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  width: 480px;
  max-width: 100%;
  height: 100%;
  background: var(--color-surface);
  box-shadow: var(--shadow-modal);
}
.drawer__head {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--color-line);
}
.drawer__title {
  margin: 0;
  color: var(--color-brown);
  font: 700 19px/26px var(--font-display);
}
.drawer__body {
  flex: 1;
  overflow: auto;
  padding: 24px;
}
.drawer__foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  min-height: 72px;
  padding: 12px 24px;
  border-top: 1px solid var(--color-line);
}

/* ---------- 7.17 РўРѕСЃС‚С‹ -------------------------------------------------- */

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 360px;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-left: 4px solid var(--color-success);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-hover);
  color: var(--color-text);
  font: 400 14px/20px var(--font-body);
}
.toast__close {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text-muted);
}
.toast--danger { border-color: var(--color-danger); }

/* ---------- 7.18 РџР°РіРёРЅР°С†РёСЏ --------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--color-line);
  color: var(--color-text-muted);
  font: 400 13px/19px var(--font-body);
}
.pagination__pages {
  display: flex;
  gap: 4px;
}
.page-btn {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: 400 14px/20px var(--font-body);
  text-decoration: none;
}
.page-btn:hover {
  border-color: var(--color-beige-line);
  background: var(--color-beige);
}
.page-btn[aria-current="page"] {
  border-color: var(--color-action);
  background: var(--color-action);
  color: var(--color-on-action);
}

/* ---------- 7.19 РџСѓСЃС‚РѕРµ, Р·Р°РіСЂСѓР·РєР°, РѕС€РёР±РєР° ------------------------------ */

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
}
.empty__image {
  width: 140px;
  height: auto;
  margin-bottom: 8px;
}
.empty__title {
  margin: 0;
  color: var(--color-brown);
  font: 700 19px/26px var(--font-display);
}
.empty__text {
  max-width: 420px;
  margin: 0 0 8px;
  color: var(--color-text-secondary);
  font: 400 14px/21px var(--font-body);
}

.skeleton {
  border-radius: var(--radius-sm);
  background: var(--color-beige);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton--line { height: 12px; }
.skeleton--title { height: 20px; width: 40%; }
.skeleton--block { height: 120px; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- 7.20 РўР°Р№РјР»Р°Р№РЅ ---------------------------------------------- */

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}
.timeline__item {
  position: relative;
  padding: 0 0 24px 36px;
}
.timeline__item:last-child {
  padding-bottom: 0;
}
.timeline__item::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 0;
  left: 9px;
  width: 2px;
  background: var(--color-line);
}
.timeline__item:last-child::before {
  display: none;
}
.timeline__dot {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-line);
  border-radius: 50%;
  background: var(--color-surface);
  color: #fff;
}
.timeline__item.is-done .timeline__dot {
  border-color: var(--color-success);
  background: var(--color-success);
}
.timeline__item.is-current .timeline__dot {
  border-color: var(--color-action);
  background: var(--color-action);
  box-shadow: 0 0 0 4px var(--color-brand-tint);
}
.timeline__dot .icon {
  width: 12px;
  height: 12px;
}
.timeline__title {
  margin: 0 0 2px;
  color: var(--color-brown);
  font: 700 15px/21px var(--font-body);
}
.timeline__meta {
  margin: 0 0 4px;
  color: var(--color-text-muted);
  font: 400 13px/19px var(--font-body);
}
.timeline__text {
  margin: 0;
  color: var(--color-text-secondary);
  font: 400 14px/21px var(--font-body);
}

/* ---------- 7.21 РЁР°РіРё --------------------------------------------------- */

.steps {
  display: flex;
  gap: 8px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}
.steps__item {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.steps__item::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--color-line);
}
.steps__item:last-child::after {
  display: none;
}
.steps__num {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font: 700 13px/1 var(--font-body);
}
.steps__label {
  overflow: hidden;
  color: var(--color-text-secondary);
  font: 400 13px/18px var(--font-body);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.steps__item.is-done .steps__num {
  border-color: var(--color-success);
  background: var(--color-success);
  color: #fff;
}
.steps__item.is-done::after {
  background: var(--color-success);
}
.steps__item.is-current .steps__num {
  border-color: var(--color-action);
  background: var(--color-action);
  color: var(--color-on-action);
}
.steps__item.is-current .steps__label {
  color: var(--color-brown);
  font-weight: 700;
}

/* ---------- 7.22 Р¤РѕСЂРјР° -------------------------------------------------- */

.form {
  max-width: 720px;
}
.form__section + .form__section {
  margin-top: 32px;
}
.form__section-title {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-brown);
  font: 700 21px/28px var(--font-display);
}
.form__grid {
  display: grid;
  gap: 20px;
}
.form-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
  padding: 12px 0;
  border-top: 1px solid var(--color-line);
  background: var(--color-bg);
}

/* ---------- 7.23 РџРѕРґРІР°Р» ------------------------------------------------- */

.footer {
  background: var(--color-brown-deep);
  color: var(--color-on-action);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.footer p {
  margin: 0;
}
.footer a {
  color: var(--color-beige-deep);
  text-decoration: none;
}
.footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ---------- РђРґР°РїС‚РёРІ ------------------------------------------------------ */

@media (max-width: 1199px) {
  .header__nav { gap: 20px; }
  .search { width: 220px; }
}

@media (max-width: 959px) {
  .sidebar { display: none; }
  .header__nav { display: none; }
  .header__actions { gap: 8px; }
  .search { width: 180px; }
  .steps__label { display: none; }
  .steps__item { flex: 0 0 auto; }
  .steps__item::after { min-width: 24px; }
}

@media (max-width: 639px) {
  .topbar__nav a:not(:first-child) { display: none; }
  .topbar a.topbar__user { display: none; }
  .header .search { display: none; }
  .header__inner { gap: 16px; }
  .header__logo { padding: 6px 8px; }
  .header__logo img { height: 36px; }
  .user__name { display: none; }
  .table-toolbar { flex-wrap: wrap; gap: 8px; }
  .table-toolbar__group { width: 100%; }
  .table-toolbar .search { width: 100%; }
  .filters { grid-template-columns: 1fr; }
  .filters__actions { flex-wrap: wrap; }
  .page-actions { flex-wrap: wrap; }
  .bulkbar { flex-wrap: wrap; }
  .bulkbar__actions { width: 100%; margin-left: 0; }
  .pagination { flex-direction: column; align-items: flex-start; }
  .modal__foot { flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .toast-stack { right: 16px; bottom: 16px; }
}

/* РўР°Р±Р»РёС†Р° в†’ РєР°СЂС‚РѕС‡РєРё */
@media (max-width: 767px) {
  .table--responsive thead {
    display: none;
  }
  .table--responsive,
  .table--responsive tbody,
  .table--responsive tr,
  .table--responsive td {
    display: block;
    width: 100%;
  }
  .table--responsive tr {
    padding: 12px 16px;
    border-top: 1px solid var(--color-line);
  }
  .table--responsive tr:first-child {
    border-top: 0;
  }
  .table--responsive td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    height: auto;
    padding: 6px 0;
    border: 0;
    text-align: right;
  }
  .table--responsive td::before {
    content: attr(data-label);
    color: var(--color-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
  }
  .table--responsive .table__check {
    width: auto;
    padding: 0;
  }
  .table--responsive .table__actions {
    width: auto;
  }
}
