/* PEAR Portal */
.pearp {
  --red: #ed1c24;
  --red-d: #be1119;
  --wine: #6e1016;
  --ink: #14161a;
  --mut: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f6f7;
  --ok: #15803d;
  --bad: #b91c1c;
  font-family: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.5;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  box-sizing: border-box;
}
.pearp *, .pearp *::before, .pearp *::after { box-sizing: border-box; }
.pearp h2, .pearp h3 { margin: 0 0 6px; line-height: 1.25; color: var(--ink); }
.pearp h2 { font-size: 28px; }
.pearp h3 { font-size: 20px; }
.pearp p { margin: 0 0 10px; }
.pearp a { color: var(--red-d); }

/* Cổng đăng nhập / đăng ký */
.pearp-gate { display: grid; grid-template-columns: 1.05fr 1fr; gap: 22px; align-items: start; }
.pearp-hero {
  background: linear-gradient(150deg, var(--red) 0%, var(--wine) 100%);
  color: #fff; border-radius: 18px; padding: 34px 30px; min-height: 380px;
  display: flex; align-items: stretch;
}
.pearp-hero-in { display: flex; flex-direction: column; width: 100%; }
.pearp .pearp-hero h2 { color: #fff; font-size: 32px; margin-bottom: 14px; }
.pearp-hero p { opacity: .92; }
.pearp-hero ul { list-style: none; padding: 0; margin: 14px 0 0; }
.pearp-hero li { padding: 9px 0 9px 26px; position: relative; border-top: 1px solid rgba(255,255,255,.22); }
.pearp-hero li::before { content: "✓"; position: absolute; left: 2px; top: 9px; font-weight: 700; }
.pearp-hero-foot { margin-top: auto; padding-top: 22px; font-size: 14px; opacity: .85; }

.pearp-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(20,22,26,.04);
}
.pearp-gate .pearp-card { display: none; margin-bottom: 0; }
.pearp-gate .pearp-card.pearp-on { display: block; }
.pearp-sub { color: var(--mut); font-size: 14px; }
.pearp-note { color: var(--mut); font-size: 13px; margin-top: 14px; }
.pearp-switch { margin-top: 14px; font-size: 14px; }

.pearp label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 14px; }
.pearp input[type="text"], .pearp input[type="tel"], .pearp input[type="email"], .pearp input[type="password"], .pearp-order input[type="search"], .pearp-order input[type="number"] {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: inherit; font-weight: 400;
  border: 1px solid #cfd3d9; border-radius: 10px; background: #fff; color: var(--ink);
}
.pearp input:focus { outline: 2px solid rgba(237,28,36,.35); border-color: var(--red); }
.pearp input:disabled { background: var(--bg); color: var(--mut); }
.pearp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 14px; }
.pearp .pearp-check { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
.pearp .pearp-check input { width: auto; margin: 0; }

.pearp-btn {
  display: inline-block; width: 100%; text-align: center; cursor: pointer; text-decoration: none;
  border: 0; border-radius: 10px; padding: 12px 18px; font: inherit; font-weight: 700;
  background: var(--red); color: #fff !important; transition: background .15s;
}
.pearp-btn:hover { background: var(--red-d); }
.pearp-btn.pearp-ghost { background: #fff; color: var(--ink) !important; border: 1px solid #cfd3d9; width: auto; }
.pearp-btn.pearp-ghost:hover { background: var(--bg); }

.pearp-alert { padding: 11px 14px; border-radius: 10px; margin: 12px 0; font-size: 14px; }
.pearp-bad { background: #fef2f2; color: var(--bad); border: 1px solid #fecaca; }
.pearp-good { background: #f0fdf4; color: var(--ok); border: 1px solid #bbf7d0; }

/* ô bẫy cho robot: người thật không thấy */
.pearp-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* chọn loại người đăng ký */
.pearp-types { border: 0; padding: 0; margin: 0 0 14px; }
.pearp-types legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 8px; }
.pearp .pearp-tile {
  display: flex; align-items: center; gap: 12px; margin: 0 0 8px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 400;
}
.pearp-tile input { margin: 0; accent-color: var(--red); }
.pearp-tile span { display: block; }
.pearp-tile b { display: block; font-weight: 700; }
.pearp-tile small { color: var(--mut); }
.pearp-tile.pearp-picked { border-color: var(--red); background: #fff5f5; }
.pearp-shop { display: none; }
.pearp-shop.pearp-open { display: block; }

/* Chờ duyệt */
.pearp-center { display: flex; justify-content: center; }
.pearp-wide { width: 100%; max-width: 640px; }
.pearp-big { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.pearp-info { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 16px 0; font-size: 14px; }
.pearp-info dt { color: var(--mut); }
.pearp-info dd { margin: 0; font-weight: 600; }
.pearp-steps { list-style: none; display: flex; gap: 10px; padding: 0; margin: 18px 0; }
.pearp-steps li { flex: 1; border-top: 4px solid var(--line); padding-top: 8px; font-size: 13px; }
.pearp-steps li b { display: block; }
.pearp-steps li small { color: var(--mut); }
.pearp-steps li.done { border-color: var(--ok); }
.pearp-steps li.now { border-color: var(--red); }
.pearp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pearp-stack { flex-direction: column; }
.pearp-stack .pearp-btn { width: 100%; }

/* Hồ sơ */
.pearp-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
  background: linear-gradient(120deg, var(--red) 0%, var(--wine) 100%); color: #fff;
  border-radius: 16px; padding: 22px 24px;
}
.pearp .pearp-banner h2 { color: #fff; margin: 0; font-size: 24px; }
.pearp-banner p { margin: 0; opacity: .9; }
.pearp-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: #fff; color: var(--red-d);
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800;
}
.pearp-chip { margin-left: auto; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.45); padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pearp-cols { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.pearp-col .pearp-card:last-child { margin-bottom: 0; }
.pearp-table { overflow-x: auto; }
.pearp-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pearp-table th, .pearp-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.pearp-table th { color: var(--mut); font-weight: 600; font-size: 13px; }
.pearp .pearp-r { text-align: right; }
.pearp-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pearp-mini { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }

/* Cổng cửa hàng / kinh doanh */
.pearp-portal { max-width: 1240px; }
.pearp-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.pearp-tab { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 10px 14px; font: inherit; font-weight: 700; color: var(--mut); cursor: pointer; }
.pearp-tab:hover { color: var(--ink); }
.pearp-tab.pearp-active { color: var(--red-d); border-bottom-color: var(--red); }
.pearp-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; text-align: center; }
.pearp-count:empty { display: none; }
.pearp-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.pearp .pearp-search, .pearp .pearp-select { flex: 1 1 260px; margin: 0; padding: 11px 12px; font: inherit; border: 1px solid #cfd3d9; border-radius: 10px; background: #fff; color: var(--ink); }
.pearp .pearp-select { flex: 0 0 auto; min-width: 160px; }
.pearp .pearp-bar .pearp-check { margin: 0; white-space: nowrap; }
.pearp-mini-btn { border: 1px solid var(--red); background: #fff; color: var(--red-d); border-radius: 8px; padding: 4px 10px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pearp-mini-btn:hover { background: #fff5f5; }
.pearp-portal .pearp-table table { min-width: 620px; }
.pearp-portal .pearp-table td:nth-child(2) { min-width: 200px; }
.pearp-empty { text-align: center; color: var(--mut); padding: 22px !important; }
.pearp .pearp-neg { color: var(--bad); }
.pearp-kpis { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0 14px; }
.pearp-kpi { background: var(--bg); border-radius: 12px; padding: 10px 16px; min-width: 180px; }
.pearp-kpi small { display: block; color: var(--mut); }
.pearp-kpi b { font-size: 20px; }
.pearp-foot { margin-top: 24px; }
.pearp-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0; transition: .25s; z-index: 99999; font-size: 14px; }
.pearp-toast-on { opacity: 1; transform: translate(-50%, 0); }

/* đơn xem thử */
.pearp-order { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 20px; align-items: start; }
.pearp-sug { margin: -8px 0 12px; }
.pearp-sug-item { display: flex; width: 100%; gap: 8px; text-align: left; background: #fff; border: 1px solid var(--line); border-top: 0; padding: 8px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.pearp-sug-item:first-child { border-top: 1px solid var(--line); border-radius: 10px 10px 0 0; }
.pearp-sug-item:last-child { border-radius: 0 0 10px 10px; }
.pearp-sug-item:hover { background: #fff5f5; }
.pearp-sug-item span { margin-left: auto; font-weight: 700; white-space: nowrap; }
.pearp-lines { margin: 4px 0 14px; }
.pearp-line { display: grid; grid-template-columns: 1fr 64px 96px 30px; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pearp-line-name b { display: block; }
.pearp-line-name span { display: block; font-size: 12px; color: var(--mut); line-height: 1.3; }
.pearp .pearp-line input { margin: 0; padding: 7px 6px; text-align: right; }
.pearp-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--mut); cursor: pointer; }
.pearp-x:hover { color: var(--bad); }
.pearp-order .pearp-actions .pearp-btn { width: auto; flex: 1 1 140px; }
.pearp-sheet-wrap { overflow-x: auto; background: var(--bg); border-radius: 14px; padding: 14px; }
.pearp-sheet { width: 640px; max-width: none; margin: 0 auto; background: #fff; color: #111; padding: 28px 30px; font-size: 13px; box-sizing: border-box; font-family: Arial, "Segoe UI", sans-serif; }
.pearp-sheet .sh-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid #ed1c24; padding-bottom: 10px; }
.pearp-sheet .sh-brand { font-size: 24px; font-weight: 800; color: #ed1c24; letter-spacing: .5px; }
.pearp-sheet .sh-sub { font-size: 12px; color: #555; margin-top: 2px; }
.pearp-sheet .sh-date { font-size: 12px; color: #444; }
.pearp-sheet .sh-title { text-align: center; font-size: 20px; font-weight: 800; margin: 16px 0 2px; }
.pearp-sheet .sh-warn { text-align: center; font-size: 11px; color: #b91c1c; margin-bottom: 12px; }
.pearp-sheet .sh-info { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pearp-sheet .sh-tbl { width: 100%; border-collapse: collapse; }
.pearp-sheet .sh-tbl th, .pearp-sheet .sh-tbl td { border: 1px solid #999; padding: 6px 6px; text-align: left; vertical-align: top; }
.pearp-sheet .sh-tbl th { background: #f3f3f3; text-align: center; font-size: 12px; }
.pearp-sheet .c { text-align: center !important; }
.pearp-sheet .r { text-align: right !important; }
.pearp-sheet .sh-words { margin-top: 8px; }
.pearp-sheet .sh-note { margin-top: 6px; }
.pearp-sheet .sh-foot { margin-top: 18px; font-size: 12px; color: #555; text-align: right; }

/* Trung tâm điều khiển */
.pearp-book { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: 8px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.pearp-book-test { background: #fef2f2; border-color: #fecaca; color: #b91c1c; font-weight: 600; }
.pm-form { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 16px; }
.pm-form h3 { margin-bottom: 12px; }
.pm-form h4 { margin: 16px 0 8px; font-size: 15px; }
.pm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; }
.pearp .pm-f { margin-bottom: 12px; }
.pm-wide { grid-column: 1 / -1; }
.pearp .pm-f input, .pearp .pm-f select, .pearp .pm-f textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400; border: 1px solid #cfd3d9; border-radius: 10px; background: #fff; color: var(--ink); }
.pm-line { display: grid; grid-template-columns: 1fr 70px 110px auto 30px; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pm-lines .pm-line input, .pm-lines .pm-line select { margin: 0; padding: 7px 6px; border: 1px solid #cfd3d9; border-radius: 8px; font: inherit; width: 100%; }
.pm-lines .pm-line input { text-align: right; }
.pm-total { background: var(--bg); border-radius: 10px; padding: 10px 14px; margin: 10px 0; min-height: 20px; }
.pm-submit { margin-top: 12px; }
.pm-submit .pearp-btn { width: auto; flex: 1 1 160px; }
.pm-done { text-align: center; }
.pm-done .pearp-actions { justify-content: center; }
.pm-done .pearp-btn { width: auto; }
.pm-cancelled td { color: var(--mut); text-decoration: line-through; }
.pm-cancelled td:last-child { text-decoration: none; }
.pm-acts { white-space: nowrap; }

@media (max-width: 860px) {
  .pm-two { grid-template-columns: 1fr; }
  .pm-line { grid-template-columns: 1fr 64px 96px 30px; }
  .pm-line select { grid-column: 1 / -1; }
  .pearp-order { grid-template-columns: 1fr; }
  .pearp-gate { grid-template-columns: 1fr; }
  .pearp-hero { min-height: 0; padding: 24px 20px; }
  .pearp .pearp-hero h2 { font-size: 24px; }
  .pearp-cols { grid-template-columns: 1fr; }
  .pearp-grid3 { grid-template-columns: 1fr; }
  .pearp-info { grid-template-columns: 1fr; gap: 0; }
  .pearp-info dd { margin-bottom: 8px; }
  .pearp-chip { margin-left: 0; }
}
