/* ArchiFlow — сметы (estimate-v13.js в чате, раздел «Деньги» в pages-v13.js), 15.11.2026. */

/* ---------- чат: маленькое действие под расчётом ---------- */
.ai > .afest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; }
.afest-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 12px;
  border: 1px solid var(--gold-line); border-radius: 15px; background: transparent;
  color: var(--gold); font: inherit; font-size: 12.5px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.afest-btn:hover { background: var(--gold-soft); }
.afest-btn:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.afest-ok { color: var(--ok); }
.afest .aftd-a { margin-left: 0; }
.afest-link { padding: 0; border: 0; background: none; color: var(--gold); font: inherit; text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: 3px; cursor: pointer; }
.afest-link:hover { text-decoration-color: var(--gold); }

/* ---------- чат: «Скачать: Excel · PDF · Word · CSV» под каждой таблицей (16.11.2026) ---------- */
.afmd > .aftd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; font-size: 12.5px; line-height: 1.2; }
.aftd-l { display: inline-flex; align-items: center; gap: 5px; color: var(--dim); margin-right: 2px; }
.aftd-a, .afest .aftd-a {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; box-sizing: border-box;
  border: 1px solid var(--line2); border-radius: 14px; color: var(--text); text-decoration: none;
  font-size: 12.5px; -webkit-tap-highlight-color: transparent;
}
.aftd-a:hover { border-color: var(--gold-line); color: var(--gold); }
.aftd-a:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.app.phone .aftd-a { min-height: 32px; padding: 0 11px; }
/* телефон: слово «Скачать» — только значком, чтобы четыре кнопки помещались в строку */
.app.phone .aftd-l { font-size: 0; gap: 0; margin-right: 0; }
.app.phone .aftd-l svg { width: 16px; height: 16px; }

/* ---------- счётчики «новое» на вкладках (pages-v13.js, server/badges.js) ---------- */
[data-afbadge]::after {
  content: attr(data-afbadge); display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; margin-left: 6px; padding: 0 5px; box-sizing: border-box; border-radius: 9px;
  background: var(--gold); color: #1c1c1e; font-size: 10.5px; font-weight: 700; font-style: normal; line-height: 1;
  vertical-align: 1px; font-variant-numeric: tabular-nums;
}
/* телефон: счётчик на кнопке «Проект» — в углу, а не строкой ниже */
.phonetabs > button[data-afbadge] { position: relative; overflow: visible; }
.phonetabs > button[data-afbadge]::after { position: absolute; top: -5px; right: -5px; margin: 0; }
/* новое есть — вместо общего числа на вкладке только счётчик нового (иначе «Деньги 1 ①» читается как два числа) */
[data-afbadge] > i { display: none; }
.afe-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 0 2px; border-top: 1px solid var(--line); }
.afe-sec b { font-weight: 600; color: var(--gold); font-size: 13px; }
.afe-sec span { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.afe-acts a.afp-btn, .afe-acts a.afg-btn { text-decoration: none; }
.afest-note { color: var(--muted); }
.afest-err { color: var(--conf); }

/* ---------- «Деньги»: список смет ---------- */
.afe-box h3 .afp-btn { margin-left: 8px; }
.afe-li {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 0; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.afg-day h3 + .afe-li { border-top: 0; }
.afe-li:hover b { color: var(--gold); }
.afe-li-t { flex: 1; min-width: 0; }
.afe-li-t b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afe-li-t small { color: var(--dim); font-size: 12px; }
.afe-li-r { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.afe-li-r b { font-weight: 600; white-space: nowrap; }
.afp-st.dr { background: #323236; color: var(--muted); }
.afe-new { margin-top: 12px; }

/* ---------- «Деньги»: смета ---------- */
.afe { margin-top: 6px; }
.afe-top { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.afe-top .afback { padding: 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.afe-top .afback:hover { color: var(--gold); }
.afe-saved { margin-left: auto; color: var(--dim); font-size: 12px; }
.afe input, .afe select {
  min-width: 0; height: 34px; box-sizing: border-box; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px;
  background: #242426; color: var(--text); font: inherit; font-size: 13.5px; color-scheme: dark;
}
.afe input:focus, .afe select:focus { outline: none; border-color: var(--gold-line); }
.afe input:disabled, .afe select:disabled { opacity: .85; border-color: transparent; background: transparent; padding-left: 0; }
.afe-title { width: 100%; margin-top: 10px; height: 40px !important; font-size: 17px !important; font-weight: 600; }
.afe-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.afe-meta span { color: var(--dim); font-size: 12px; }
.afe-table { padding-bottom: 12px; }
.afe-head { display: flex; justify-content: space-between; gap: 8px; color: var(--dim); font-size: 11.5px; padding-bottom: 6px; }
.afe-row {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) 30px; gap: 6px 8px; align-items: center;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.afe-head + .afe-row { border-top: 0; }
.afe-n { color: var(--dim); font-size: 12px; text-align: right; }
.afe-name { width: 100%; }
.afe-del { width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--dim); cursor: pointer; font-size: 12px; }
.afe-del:hover { color: var(--conf); background: var(--conf-soft); }
.afe-calc { grid-column: 2 / 4; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.afe-calc input { flex: none; }
.afe-res { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.afe-calc i { color: var(--dim); font-style: normal; font-size: 12px; }
.afe-qty { width: 64px; text-align: right; }
.afe-unit { width: 66px; }
.afe-price { width: 96px; text-align: right; }
.afe-sum { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.afe-add { margin-top: 8px; }
.afe-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.afe-total span { color: var(--muted); }
.afe-total b { color: var(--gold); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.afe-note { margin-top: 10px; }
.afe-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.afe-acts .afp-btn, .afe-acts .afg-btn { height: 34px; display: inline-flex; align-items: center; border: 1px solid var(--line2); cursor: pointer; font: inherit; font-size: 13px; }
.afe-acts .afg-btn { border-color: var(--gold); color: #1c1c1e; padding: 0 16px; }
.afe-acts .afp-btn { background: transparent; color: var(--text); border-radius: 16px; padding: 0 14px; }
.afe-acts .afe-rm { margin-left: auto; color: var(--muted); }
.afe-acts .afe-rm:hover { color: var(--conf); border-color: var(--conf); }
.afe-link { width: 100%; height: 36px; margin: 8px 0 4px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #242426; color: var(--text); font: inherit; font-size: 13px; }
@media (max-width: 420px) {
  /* телефон: кол-во, ед. и цена — во всю ширину строки, сумма при нехватке места — строкой ниже справа */
  .afe-qty { width: 52px; } .afe-unit { width: 58px; } .afe-price { width: 84px; }
  .afe-calc { grid-column: 1 / 4; gap: 4px; }
}
