/* Trang Dự toán chi phí (/du-toan-chi-phi) */
.est { max-width: 1080px; margin: 24px auto 48px; }

.est-hero {
  text-align: center; padding: 36px 20px 28px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #1f6fc4 100%);
}
.est-eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.est-hero h1 { font-size: 2rem; margin: 6px 0 8px; color: #fff; }
.est-hero p { max-width: 560px; margin: 0 auto; opacity: .95; line-height: 1.55; }

/* Thanh bước */
.est-steps { list-style: none; display: flex; justify-content: center; gap: 8px; margin: 22px 0 18px; padding: 0; flex-wrap: wrap; }
.est-steps li {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 999px;
  background: #f1f3f2; color: #777; font-size: .88rem; font-weight: 600;
}
.est-steps li span {
  width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: #888; font-size: .8rem;
}
.est-steps li.is-active { background: var(--primary); color: #fff; }
.est-steps li.is-active span { color: var(--primary); }
.est-steps li.is-done { background: #e6f3fe; color: var(--primary-dark); cursor: pointer; }
.est-steps li.is-done span { background: var(--primary); color: #fff; }
.est-steps li.is-skip { opacity: .4; }

.est-stage { background: #fff; border: 1px solid #e6e9e7; border-radius: 16px; padding: 28px; }

.est-head { text-align: center; margin-bottom: 22px; }
.est-head__eyebrow { font-size: .78rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; }
.est-head h2 { font-size: 1.45rem; margin: 6px 0; }
.est-head p { color: #666; margin: 0; }

.est-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.est-link { background: none; border: 0; padding: 4px 0; color: var(--primary-dark); font-weight: 600; cursor: pointer; font-size: .92rem; }
.est-link:hover { text-decoration: underline; }
.est-chip { background: #e6f3fe; color: var(--primary-dark); font-size: .85rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; }

/* Thẻ chọn */
.est-grid { display: grid; gap: 14px; }
.est-grid--projects { grid-template-columns: repeat(3, 1fr); }
.est-grid--budgets { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.est-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 18px; border: 1.5px solid #e2e6e3; border-radius: 14px; background: #fff; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s; font: inherit; color: inherit;
}
.est-card:hover { border-color: var(--primary); box-shadow: 0 6px 18px rgba(55,160,242,.15); transform: translateY(-2px); }
.est-card strong { font-size: 1.08rem; }
.est-card__desc { color: #666; font-size: .9rem; line-height: 1.5; }
.est-card__icon {
  width: 46px; height: 46px; border-radius: 12px; background: #e6f3fe; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.est-card__icon svg { width: 26px; height: 26px; }
.est-badge { font-size: .72rem; font-weight: 700; color: #fff; background: var(--accent); padding: 3px 8px; border-radius: 999px; }

/* Quy mô */
.est-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; max-width: 720px; margin: 0 auto; }
.est-subhead { max-width: 720px; margin: 22px auto 10px; font-size: 1rem; color: #444; }
.est-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid #e6e9e7; border-radius: 12px; }
.est-field label { font-weight: 600; }
.est-field label small { font-weight: 400; color: #888; }
.est-stepper { display: flex; align-items: center; border: 1px solid #dcdfdd; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.est-stepper button { width: 34px; height: 34px; border: 0; background: #f4f6f5; font-size: 1.1rem; cursor: pointer; color: #333; }
.est-stepper button:hover { background: #e6f3fe; color: var(--primary-dark); }
.est-stepper input { width: 46px; height: 34px; border: 0; text-align: center; font-weight: 700; font-size: 1rem; -moz-appearance: textfield; }
.est-stepper input::-webkit-outer-spin-button, .est-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.est-actions { display: flex; gap: 10px; margin-top: 24px; }
.est-actions--right { justify-content: flex-end; max-width: 720px; margin-left: auto; margin-right: auto; }
.est-btn { padding: 11px 22px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.est-btn--block { display: block; width: 100%; text-align: center; margin-top: 10px; }
.est-btn:disabled { opacity: .6; cursor: default; }

/* Đang tải / lỗi */
.est-loading, .est-error { text-align: center; padding: 48px 10px; }
.est-loading strong { display: block; margin-top: 14px; }
.est-spinner {
  display: inline-block; width: 38px; height: 38px; border-radius: 50%;
  border: 4px solid #e6f3fe; border-top-color: var(--primary); animation: est-spin .8s linear infinite;
}
@keyframes est-spin { to { transform: rotate(360deg); } }
.est-error p { color: #666; margin: 8px 0 18px; }

/* Kết quả */
.est-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; font-weight: 600; font-size: .9rem; }
.est-switch__opt { border: 1.5px solid #dcdfdd; background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; font-weight: 600; }
.est-switch__opt:hover { border-color: var(--primary); color: var(--primary-dark); }
.est-switch__opt.is-active { background: var(--primary); border-color: var(--primary); color: #fff; cursor: default; }

.est-result-hero { background: linear-gradient(135deg, #f2f8fe, #e6f3fe); border-radius: 14px; padding: 22px; margin-bottom: 16px; }
.est-result-hero h2 { font-size: 1.8rem; color: var(--primary-dark); margin: 4px 0; }
.est-result-meta { color: #555; margin: 0; }
.est-benefit { margin-top: 14px; }
.est-benefit strong { font-size: .9rem; }
.est-benefit p { margin: 4px 0 0; color: #444; line-height: 1.6; font-size: .93rem; }
.est-benefit__note { font-size: .85rem !important; color: #666 !important; margin-top: 8px !important; }

.est-notice { background: #fff8e6; border: 1px solid #f3dc9b; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: .9rem; }
.est-notice ul { margin: 6px 0 0; padding-left: 18px; }

.est-result { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.est-result__title { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid #eee; padding-bottom: 8px; margin-bottom: 4px; }
.est-result__title h3 { margin: 0; font-size: 1.1rem; }
.est-result__title span { color: #888; font-size: .85rem; }

.est-item { display: grid; grid-template-columns: 64px 1fr 48px 140px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.est-item__img { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #f6f7f6; display: block; }
.est-item__img img { width: 100%; height: 100%; object-fit: contain; }
.est-item__main a { color: inherit; }
.est-item__main a:hover strong { color: var(--primary-dark); }
.est-item__main strong { font-size: .93rem; line-height: 1.35; display: block; }
.est-item__main small { color: #888; font-size: .8rem; }
.est-item__main p { margin: 3px 0 0; color: #666; font-size: .82rem; line-height: 1.45; }
.est-item__qty { text-align: center; }
.est-item__qty span { display: block; font-size: .72rem; color: #999; }
.est-item__qty b { font-size: 1.05rem; }
.est-item__price { text-align: right; }
.est-item__price small, .est-item__price span { display: block; font-size: .75rem; color: #999; }
.est-item__price strong { color: var(--accent); font-size: 1rem; }

.est-perks { margin-top: 16px; }
.est-perks h3 { font-size: 1rem; margin-bottom: 8px; }
.est-perk { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: #f2f8fe; border-radius: 10px; }
.est-perk > span { color: var(--primary); font-weight: 700; }
.est-perk em { font-style: normal; color: var(--primary-dark); font-weight: 600; }

.est-summary { position: sticky; top: 90px; border: 1.5px solid #e2e6e3; border-radius: 14px; padding: 18px; background: #fff; }
.est-summary__label { font-size: .82rem; color: #777; font-weight: 600; }
.est-summary__range { display: block; font-size: 1.25rem; color: var(--primary-dark); margin: 4px 0 10px; line-height: 1.3; }
.est-summary__total { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px dashed #ddd; border-bottom: 1px dashed #ddd; }
.est-summary__total b { color: var(--accent); font-size: 1.1rem; }
.est-summary p { font-size: .82rem; color: #666; line-height: 1.5; margin: 10px 0 4px; }
.est-summary small { display: block; margin-top: 10px; font-size: .75rem; color: #999; }
.est-summary__msg { margin-top: 10px; font-size: .85rem; padding: 8px 10px; border-radius: 8px; }
.est-summary__msg.is-ok { background: #e6f3fe; color: var(--primary-dark); }
.est-summary__msg.is-err { background: #fdecea; color: #c62828; }

.est-foot { text-align: center; margin-top: 20px; }

@media (max-width: 900px) {
  .est-grid--projects { grid-template-columns: repeat(2, 1fr); }
  .est-result { grid-template-columns: 1fr; }
  .est-summary { position: static; }
}
@media (max-width: 600px) {
  .est { margin-top: 12px; }
  .est-hero { padding: 26px 16px 22px; border-radius: 12px; }
  .est-hero h1 { font-size: 1.5rem; }
  .est-stage { padding: 18px 14px; border-radius: 12px; }
  .est-steps li { padding: 5px 10px 5px 5px; font-size: .78rem; }
  .est-grid--projects { grid-template-columns: 1fr 1fr; gap: 10px; }
  .est-card { padding: 14px; }
  .est-card__desc { font-size: .8rem; }
  .est-fields { grid-template-columns: 1fr; }
  .est-item { grid-template-columns: 52px 1fr; grid-template-areas: "img main" "img qp"; }
  .est-item__img { width: 52px; height: 52px; grid-area: img; align-self: start; }
  .est-item__main { grid-area: main; }
  .est-item__qty, .est-item__price { display: none; }
  .est-item::after {
    grid-area: qp; content: attr(data-mobile); font-size: .85rem; color: var(--accent); font-weight: 700;
  }
  .est-result-hero h2 { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .est-card, .est-spinner { transition: none; animation: none; }
}
