.template-chip{
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: 0 18px 24px -22px rgba(18, 28, 24, 0.18);
  font-size: 13px;
  font-weight: 760;
}

.template-chip:hover{
  color: var(--accent);
  background: #fff;
}

.market-cards{
  display: grid;
  gap: var(--space-6);
}

.market-card{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 18px;
  align-items: start;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid rgba(18, 28, 24, 0.28);
  border-radius: 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 22px 34px -22px rgba(18, 28, 24, 0.34);
}

.market-card h3{
  max-width: 860px;
  margin: 10px 0 7px;
  color: #0d1413;
  font-size: 21px;
  font-weight: 920;
  letter-spacing: -0.018em;
  line-height: 1.14;
}

.market-card-meta{
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  width: min(100%, 820px);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.market-card-meta span{
  display: grid;
  gap: 2px;
  min-width: 0;
}

.market-card-meta small{
  color: #7d8984;
  font-size: 12px;
  font-weight: 680;
  text-transform: none;
}

.market-card-meta strong{
  font-size: 14px;
  font-weight: 720;
}

.market-card-actions{
  display: flex;
  width: auto;
  min-width: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.market-card-actions .btn{
  width: 126px;
  max-width: 100%;
  min-height: 38px;
  border-radius: 4px;
  font-weight: 760;
}

.market-card-actions [data-report-request]{
  width: auto;
  align-self: center;
  margin-top: 2px;
  color: #9f2f2a;
  background: transparent;
  border-color: transparent;
}

.market-card-actions [data-report-request]:hover{
  background: transparent;
  border-color: transparent;
  box-shadow: 0 18px 24px -22px rgba(184, 50, 46, 0.28);
}

.market-card-actions .btn:not(.btn-primary):not([data-report-request]){
  color: var(--text);
  background: #fff;
  border-color: var(--border);
}

.market-card-actions .btn:not(.btn-primary):not([data-report-request]):hover{
  background: #fff;
  border-color: var(--border);
  box-shadow: 0 18px 24px -22px rgba(18, 28, 24, 0.28);
}

.advanced-table{
  display: none;
}

.filters{
  position: sticky;
  top: 96px;
  z-index: 1;
  display: grid;
  width: auto;
  max-height: calc(100vh - 120px);
  gap: 14px;
  padding: 18px;
  overflow: auto;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transform: none;
  transition: transform 0.22s ease;
}

body.filters-open .filters{
  transform: none;
}

.filter-head,
.board-actions{
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.filter-close,
[data-filter-toggle]{
  display: none;
}

label{
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 720;
}

.field-label{
  display: block;
  min-height: 16px;
}

.optional{
  margin-left: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-note{
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

input,
select,
textarea{
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(18, 28, 24, 0.32);
  border-radius: var(--radius-md);
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

textarea{
  min-height: 132px;
  padding-top: 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 0;
  width: auto;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.btn:hover{
  border-color: var(--line-strong);
  box-shadow: none;
}

.btn-primary{
  min-height: 36px;
  padding: 0 14px;
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
  font-weight: 780;
}

.btn-primary:hover{
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-ghost,
[data-report-request]{
  min-height: 30px;
  padding: 0 6px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.btn-secondary{
  color: var(--steel);
  background: var(--steel-soft);
  border-color: var(--line);
}

.btn-muted{
  color: var(--muted);
  background: transparent;
  border-color: var(--border);
  cursor: default;
  pointer-events: none;
}

.btn-danger{
  color: #a33a34;
  background: #fff;
  border-color: #e5c7c4;
}

.btn-chat{
  color: #fff;
  background: var(--dark);
  border-color: var(--dark);
  box-shadow: none;
}

.btn-chat:hover{
  background: #000;
  border-color: #000;
}

.text-link{
  color: var(--primary);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.counter{
  display: inline-flex;
  min-width: auto;
  min-height: auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 760;
}

.table-scroll{
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.request-table{
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.92);
}

.request-table th,
.request-table td{
  padding: 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.request-table th{
  color: var(--muted);
  background: #f4f8f6;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.request-table tr:last-child td{
  border-bottom: 0;
}

.request-table tbody tr{
  transition:
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.request-table tbody tr:hover td{
  background: #fbfdfc;
}

.request-table tr.accepted-row td{
  background: var(--surface);
  border-bottom-color: #bbf7d0;
}

.request-table tr.accepted-row td:first-child{
  box-shadow: inset 3px 0 0 var(--success);
}

.request-title{
  display: grid;
  gap: 6px;
  min-width: 280px;
  min-inline-size: 0;
}

.request-title strong{
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.request-title span,
.muted{
  color: var(--muted);
  font-size: 13px;
}

.accepted-line{
  color: var(--green);
  font-weight: 900;
}

.published-line{
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.tag-row{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag{
  display: inline-flex;
  min-height: 0;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: #45504b;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  box-shadow: none;
  overflow-wrap: anywhere;
}

.tag.status-open::before,
.tag.status-urgent::before,
.tag.status-accepted::before,
.tag.status-declined::before,
.tag.status-discussing::before{
  display: none;
}

.status-open,
.status-discussing{
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #b9dcea;
}

.status-urgent{
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #fde68a;
}

.status-accepted{
  color: var(--success);
  background: var(--success-soft);
  border-color: #bbf7d0;
}

.status-declined{
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fecaca;
}

.compact-list,
.cards-grid{
  display: grid;
  gap: var(--space-5);
}

.compact-item,
.request-card,
.offer-item{
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid rgba(18, 28, 24, 0.28);
  border-radius: var(--radius);
  box-shadow: 0 22px 30px -24px rgba(18, 28, 24, 0.32);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.compact-item:hover,
.request-card:hover,
.offer-item:hover{
  transform: translateY(-1px);
  border-color: rgba(18, 28, 24, 0.42);
  box-shadow: 0 24px 34px -24px rgba(18, 28, 24, 0.42);
}

.compact-item-header,
.card-header{
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
}

.compact-item strong,
.request-card h3,
.offer-item strong{
  line-height: 1.22;
}

.offer-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row .btn,
.offer-actions .btn,
.form-actions .btn{
  min-width: 0;
  width: auto;
}

.request-table td:last-child .tag-row{
  display: grid;
  justify-items: stretch;
}

.request-table td:last-child .btn{
  width: 132px;
}

.request-table td[data-label="Бюджет"] strong{
  color: var(--ink);
  font-size: 16px;
}

.meta-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.meta-box{
  min-height: 58px;
  padding: 9px;
  background: var(--panel-2);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-nested);
}

.meta-box span{
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meta-box strong{
  display: block;
  margin-top: 3px;
  font-size: 14px;
}
