/* Фильтр периода — сага тендеров (реестр + tools) */

.tpf-wrap {
  position: relative;
  width: 100%;
  min-width: 180px;
}

.tpf-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--brd-2, var(--border, rgba(255,255,255,.12)));
  border-radius: var(--r-md, 8px);
  background: var(--field-bg, var(--inner-bg, rgba(255,255,255,.04)));
  color: var(--t-1, inherit);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.tpf-trigger:hover {
  border-color: color-mix(in srgb, var(--gold, #c9a35b) 55%, transparent);
}

.tpf-trigger[aria-expanded="true"] {
  border-color: var(--gold, #c9a35b);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold, #c9a35b) 22%, transparent);
}

.tpf-trigger-ic { flex: 0 0 auto; opacity: .9; }
.tpf-trigger-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: capitalize;
}
.tpf-trigger-caret {
  flex: 0 0 auto;
  color: var(--t-3, #888);
  font-size: 11px;
}

.tpf-pop {
  display: none;
  position: fixed;
  z-index: 50000;
  padding: 14px;
  border: 1px solid var(--brd-2, rgba(255,255,255,.12));
  border-radius: 12px;
  background: var(--card-bg, var(--bg-2, #16161a));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color: var(--t-1, #eee);
}

.tpf-pop.open { display: block; }

.tpf-head {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--t-1);
}

.tpf-section + .tpf-section { margin-top: 12px; }

.tpf-label {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--t-3, #999);
}

.tpf-hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--t-3, #999);
}

.tpf-seg,
.tpf-tabs,
.tpf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tpf-seg button,
.tpf-tabs button,
.tpf-chip {
  padding: 7px 11px;
  border: 1px solid var(--brd-2, rgba(255,255,255,.12));
  border-radius: 999px;
  background: var(--inner-bg, rgba(255,255,255,.04));
  color: var(--t-2, #ccc);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.tpf-seg button.on,
.tpf-tabs button.on,
.tpf-chip.on {
  border-color: color-mix(in srgb, var(--gold, #c9a35b) 50%, transparent);
  background: var(--gold-bg, color-mix(in srgb, var(--gold, #c9a35b) 14%, transparent));
  color: var(--t-1, #fff);
  font-weight: 600;
}

.tpf-month-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 240px;
  overflow: auto;
  padding: 2px;
  border: 1px solid var(--brd-1, rgba(255,255,255,.08));
  border-radius: 8px;
  background: var(--inner-bg, rgba(0,0,0,.15));
}

.tpf-month-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--t-2, #ccc);
  font: inherit;
  font-size: 13px;
  text-transform: capitalize;
  cursor: pointer;
}

.tpf-month-item:hover {
  background: color-mix(in srgb, var(--gold, #c9a35b) 10%, transparent);
  color: var(--t-1);
}

.tpf-month-item.on {
  background: var(--gold-bg, color-mix(in srgb, var(--gold, #c9a35b) 16%, transparent));
  color: var(--t-1);
  font-weight: 600;
}

.tpf-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tpf-date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--t-3);
}

.tpf-date-field .inp { width: 100%; }

.tpf-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--brd-1, rgba(255,255,255,.08));
}

.reg-toolbar-field.reg-toolbar-period {
  min-width: 240px;
  flex: 1 1 240px;
  max-width: 360px;
}

html[data-theme="light"] .tpf-pop {
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

@media (max-width: 720px) {
  .tpf-range { grid-template-columns: 1fr; }
  .reg-toolbar-field.reg-toolbar-period { max-width: none; }
}
