/* ====== Tokens (iOS-like) ====== */
:root{
  --bg: #f6f7f9;
  --card: #ffffff;
  --border: #e6e8eb;
  --text: #0b0c0d;
  --muted: #667085;
  --ring: #e73935;            /* Apple green */
  --ring-soft: #f5f5f5;
  --chip-bg: #ffc412;
  --chip-bd: #e5e7eb;
  --shadow: 0 6px 20px rgba(0,0,0,.06);
  --radius: 14px;
}

/* Root */
.bcp-root{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
}

/* ====== Overview card ====== */
.bcp-overview{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

/* tiêu đề trong form tổng quan */
.bcp-overview h3{
  text-align: center;
  font-size: clamp(18px, 2.4vw, 20px);
  font-weight: 700;
  letter-spacing: .02em;
  margin: 6px 0 18px;
  line-height: 1.25;
}


/* Grid responsive cho toàn bộ input/select */
.bcp-grid{
  --cols: 3;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(var(--cols), minmax(0,1fr));
}
@media (max-width: 1023.98px){ .bcp-grid{ --cols: 2; } }
@media (max-width: 639.98px) { .bcp-grid{ --cols: 1; } }

.bcp-grid label{
  font-size: 12px;
  color: var(--muted);
  display:flex;
  flex-direction:column;
  gap:6px;
}

/* Inputs – sửa lỗi “mất nửa chữ” bằng chiều cao & line-height chuẩn */
.bcp-grid input,
.bcp-grid select{
  appearance: none;
  -webkit-appearance: none;
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 10px;
  height: 40px;               /* <- đảm bảo chữ không bị cắt */
  line-height: 24px;          /* <- baseline chuẩn */
  font-size: 15px;
  color: var(--text);
  width:100%;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.bcp-grid input:focus,
.bcp-grid select:focus{
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px var(--ring-soft);
  background:#fff;
}

/* ====== Tabs (segmented control) ====== */
.bcp-tabs{
  display:grid;
  gap:12px;
  grid-template-columns: 1fr;              /* mobile: 1 cột */
  margin:14px 0 6px;
}

@media (min-width: 768px){                 /* desktop/tablet: 3 cột bằng nhau */
  .bcp-tabs{
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Nút tab full width trong ô lưới */
.bcp-tabs button{
  width:100%;
  box-sizing:border-box;
  padding:14px 16px;
  border-radius:999px;
  border:1px solid #e73935;
  background:#fff;
  color:#111;
  font-weight:600;
  line-height:1;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(0,0,0,.06);
  transition:transform .05s ease, background .15s ease, border-color .15s ease;
}
.bcp-tabs button:hover{ background:#fafafa; }
.bcp-tabs button:active{ transform:translateY(1px); }

/* Trạng thái active */
.bcp-tabs button.active{
  background:#e73935;         /* hoặc màu thương hiệu của bạn */
  border-color:#e73935;
  color:#fff;
}

/* ====== Discount chips ====== */
.bcp-discounts{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom: 10px; }
.bcp-chip{
  background: var(--chip-bg);
  border:1px solid var(--chip-bd);
  border-radius: 999px;
  padding: 5px 12px;
  display:flex; gap:8px; align-items:center;
  font-weight:600; color:#000;
  font-size: 14px;
}

/* ====== Cards ====== */
.bcp-cards{
  display:grid;
  grid-template-columns: repeat(12, minmax(0,1fr));
  gap:12px; margin: 12px 0 6px;
}
.bcp-card{
  grid-column: span 6;                /* 2 cột trên màn hình lớn */
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:16px 16px 14px;
  box-shadow: var(--shadow);
}
@media (max-width: 767.98px){ .bcp-card{ grid-column: span 12; } }

.bcp-card .ttl{ font-size: 12px; color: var(--muted); }
.bcp-card .val{ font-size: 16px; font-weight: 700; margin-top: 6px; letter-spacing: .2px; }
.bcp-card.loan .sub,
.bcp-card .sub{ font-size:12px; color:#6b7280; margin-top:6px; }

.bcp-card.loan{ grid-column: span 12; } /* thẻ loan full width */

/* ====== Sections ====== */
.bcp-section{ margin: 18px 0 8px; }
.bcp-section h4{font-size:20px; font-weight:700;}
.bcp-pane{ display:none; }
.bcp-pane.active{ display:block; }

/* ====== Table ====== */
.bcp-table{ width:100%; border-collapse: separate; border-spacing: 0; font-family:var(--wp--preset--font-family--system-font);font-size:14px; }
.bcp-table th, .bcp-table td{
  border:1px solid var(--border);
  padding:12px 14px; text-align:left;
  background:#fff;
}
.bcp-table th{
  background: #f3f4f6;
  font-weight: 700;
}
.bcp-table tr:first-child th{ border-top-left-radius: 10px; border-top-right-radius: 10px;text-align: center;}
.bcp-table tr td:first-child{text-align: center;}
.bcp-table tr:first-child th:last-child{ border-top-right-radius: 12px; }
.bcp-table tr:last-child td:first-child{ border-bottom-left-radius: 12px; }
.bcp-table tr:last-child td:last-child{ border-bottom-right-radius: 12px; }

/* ====== Export buttons (đẹp & canh giữa) ====== */
.bcp-export{
  display:flex; justify-content:center; gap:12px;
  margin: 14px 0 4px;
}
.bcp-export .bcp-dl{
  border:0; padding:11px 16px; border-radius: 999px;
  background: #ff5722; color:#fff; cursor:pointer;
  box-shadow: var(--shadow);
  font-weight: 700;
  transition: transform .06s ease, opacity .15s ease, box-shadow .15s ease;
}
.bcp-export .bcp-dl:hover{ opacity:.92; box-shadow: 0 12px 28px rgba(0,0,0,.12); }
.bcp-export .bcp-dl:active{ transform: translateY(1px) scale(.99); }

/* Ẩn cụm nút khi đang chụp ảnh */
.bcp-root.exporting .bcp-export{ display:none !important; }

/* Khi render xuất ảnh, thay input bằng box text (nếu bạn dùng thủ thuật thay thế) */
.export-input{ font: inherit; line-height: 1.3; }