/* ==========================================================================
   VN PREMIUM LAB - nen tang giao dien dung chung (website + quan tri)
   Phong cach: phang, ro net, mau teal - navy chuyen nha khoa
   ========================================================================== */
@import url('fonts.css');

:root {
  --ink: #14303a;
  --ink-2: #48616b;
  --ink-3: #7b9099;
  --line: #dbe5e8;
  --line-2: #c9d7db;
  --bg: #f3f7f8;
  --white: #ffffff;
  --brand: #0a6f7c;
  --brand-d: #07525c;
  --brand-dd: #0d3b44;
  --brand-l: #e2f1f2;
  --brand-ll: #f0f8f8;
  --ok: #17794f;
  --ok-bg: #e4f4ec;
  --warn: #9a6a12;
  --warn-bg: #fbf1dc;
  --bad: #b3322d;
  --bad-bg: #fbe8e7;
  --info-bg: #e7f0f8;
  --radius: 6px;
  --font: 'Roboto', Ubuntu, sans-serif;
  --shadow-1: 0 1px 2px rgba(20, 48, 58, .06);
  --shadow-2: 0 4px 14px rgba(20, 48, 58, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.6;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-d); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; color: var(--ink); font-weight: 600; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ic { flex: none; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ---- Nut bam ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border: 1px solid var(--brand); border-radius: var(--radius);
  background: var(--brand); color: #fff; font: 600 14px/1 var(--font); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn:hover { background: var(--brand-d); border-color: var(--brand-d); color: #fff; }
.btn-light { background: #fff; color: var(--brand-d); border-color: var(--line-2); }
.btn-light:hover { background: var(--brand-ll); color: var(--brand-d); border-color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover { background: var(--brand-ll); color: var(--brand-d); border-color: transparent; }
.btn-danger { background: #fff; color: var(--bad); border-color: #e3b9b6; }
.btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---- Form --------------------------------------------------------------- */
label { display: block; font-weight: 500; font-size: 13.5px; margin-bottom: 6px; color: var(--ink); }
label .req { color: var(--bad); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: #fff; color: var(--ink); font: 400 14px var(--font); transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.select { padding-right: 30px; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2348616b' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10, 111, 124, .15); }
.input::placeholder, .textarea::placeholder { color: #9bacb3; }
.field { margin-bottom: 16px; }
.field .help { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.field .err { font-size: 12.5px; color: var(--bad); margin-top: 5px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 18px; }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
/* bay mat ong (honeypot) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Thong bao & huy hieu ---------------------------------------------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid; margin-bottom: 16px; font-size: 14px; }
.alert .ic { margin-top: 2px; }
.alert-success { background: var(--ok-bg); border-color: #b5ddc8; color: #0f5a39; }
.alert-error { background: var(--bad-bg); border-color: #efc4c1; color: #8a2420; }
.alert-warn { background: var(--warn-bg); border-color: #ecd6a2; color: #6e4a08; }
.alert-info { background: var(--info-bg); border-color: #c1d6ea; color: #1d4a73; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: #eaf0f2; color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-brand { background: var(--brand-l); color: var(--brand-d); }

/* ---- Bang --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--ink-2); background: #eef4f6; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--brand-ll); }
.table .actions { white-space: nowrap; text-align: right; }

/* ---- Phan trang --------------------------------------------------------- */
.pager { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin: 22px 0 4px; }
.pager .pg { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink-2); font-size: 14px; }
.pager a.pg:hover { border-color: var(--brand); color: var(--brand); }
.pager .current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager .gap { border: 0; background: transparent; }

/* ---- Chip vi tri rang --------------------------------------------------- */
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 4px;
  background: var(--brand-d); color: #fff; font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Trang loi / rong --------------------------------------------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty .ic { color: var(--line-2); margin-bottom: 10px; }

/* ---- So do vi tri rang trong cung ham (Dental Chart FDI) ---- */
.dental-chart-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
  box-shadow: 0 2px 10px rgba(10, 111, 124, 0.05);
}
.dental-chart-box .chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  background: #f8fbfb;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.dental-chart-box .chart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--brand-dd);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: 12.5px;
}
.dental-chart-box .chart-badge {
  background: var(--brand-l);
  color: var(--brand-d);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 4px;
  border: 1px solid rgba(10, 111, 124, 0.18);
}
.dental-chart-box .chart-container {
  position: relative;
  padding: 16px 12px;
  background: linear-gradient(180deg, #fbfdfd 0%, #f3f8f9 50%, #fbfdfd 100%);
  overflow-x: auto;
}
.dental-chart-box .chart-side-label {
  position: absolute;
  top: 50%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #7b9fa6;
  text-transform: uppercase;
  pointer-events: none;
}
.dental-chart-box .label-right {
  left: 6px;
  transform: translateY(-50%) rotate(-90deg);
}
.dental-chart-box .label-left {
  right: 6px;
  transform: translateY(-50%) rotate(90deg);
}
.dental-chart-box .arch-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 6px;
}
.dental-chart-box .arch-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.dental-chart-box .arch-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  max-width: 100%;
}
.dental-chart-box .quad-group {
  display: flex;
  align-items: center;
  gap: 3px;
}
.dental-chart-box .arch-midline {
  width: 2px;
  height: 48px;
  background: #cbd5e1;
  margin: 0 8px;
  border-radius: 2px;
  position: relative;
}
.dental-chart-box .arch-midline::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
}
.dental-chart-box .jaw-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px 0;
  width: 80%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.dental-chart-box .jaw-separator .line {
  flex: 1;
  height: 1px;
  background: #dbe5e8;
  border-top: 1px dashed #cbd5e1;
}
.dental-chart-box .jaw-separator .lbl {
  font-size: 10px;
  font-weight: 600;
  color: #7b9fa6;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 99px;
}
.dental-chart-box .tooth-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border-radius: 6px;
  transition: transform .15s ease, background-color .15s;
  min-width: 32px;
  cursor: default;
}
.dental-chart-box .tooth-item:hover {
  transform: translateY(-2px);
  background: rgba(10, 111, 124, 0.05);
}
.dental-chart-box .tooth-shape {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dental-chart-box .tooth-item.is-active .tooth-shape {
  filter: drop-shadow(0 2px 5px rgba(10, 111, 124, 0.4));
}
.dental-chart-box .tooth-pin {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 13px;
  height: 13px;
  background: #10b981;
  color: #fff;
  border-radius: 50%;
  font-size: 8.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 1.5px solid #fff;
}
.dental-chart-box .tooth-num {
  font-size: 11px;
  font-family: 'Roboto', Arial, sans-serif;
  line-height: 1;
}
.dental-chart-box .tooth-item.is-active .tooth-num {
  color: var(--brand-d) !important;
  font-weight: 800 !important;
}
.dental-chart-box .chart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
}
.dental-chart-box .chart-legends {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.dental-chart-box .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.dental-chart-box .legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.dental-chart-box .legend-dot.active {
  background: var(--brand);
  border: 1px solid var(--brand-d);
}
.dental-chart-box .legend-dot.inactive {
  background: #fff;
  border: 1.5px solid #cbd5e1;
}
.dental-chart-box .legend-teeth-list {
  font-size: 12px;
  color: var(--ink-2);
}
.dental-chart-box .legend-teeth-list strong {
  color: var(--brand-dd);
}
@media (max-width: 640px) {
  .dental-chart-box .tooth-item { min-width: 22px; }
  .dental-chart-box .tooth-shape svg { width: 24px; height: 24px; }
  .dental-chart-box .tooth-num { font-size: 9.5px; }
  .dental-chart-box .chart-side-label { display: none; }
}

/* ---- So do rang 3D Giai phau chuyen nghiep -------------------------------- */
.dental-chart-3d {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 14px;
  box-shadow: 0 4px 16px rgba(7, 82, 92, 0.06);
}
.dental-chart-3d .chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  background: #f7fafb;
  border-bottom: 1px solid var(--line);
}
.dental-chart-3d .chart-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dental-chart-3d .chart-title strong {
  display: block;
  font-size: 13.5px;
  color: var(--brand-d);
  letter-spacing: .02em;
}
.dental-chart-3d .chart-title small {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 500;
}
.dental-chart-3d .chart-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dental-chart-3d .chart-badge {
  background: #dcfce7;
  color: #166534;
  font-size: 14px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid #bbf7d0;
  box-shadow: 0 1px 2px rgba(22, 101, 52, 0.08);
}
.dental-chart-3d .chart-view-toggle {
  display: inline-flex;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 2px;
  border-radius: 4px;
  gap: 2px;
}
.dental-chart-3d .chart-view-toggle .view-btn {
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  padding: 6px 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dental-chart-3d .chart-view-toggle .view-btn:hover {
  color: var(--brand-d);
}
.dental-chart-3d .chart-view-toggle .view-btn.active {
  background: #ffffff;
  color: var(--brand-d);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.dental-chart-3d .chart-canvas-wrap {
  position: relative;
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f6fafb 100%);
  padding: 16px 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 340px;
}
.dental-chart-3d .dental-view-panel {
  width: 100%;
  display: flex;
  justify-content: center;
}
.dental-chart-3d .two-jaws-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 620px;
}
.dental-chart-3d .jaw-arch-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.dental-chart-3d .jaw-arch-header {
  padding: 10px 16px;
  color: #ffffff;
  font-size: 15.5px;
  letter-spacing: .02em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dental-chart-3d .jaw-arch-header strong {
  font-size: 15.5px;
  font-weight: 700;
}
.dental-chart-3d .jaw-tag-badge {
  background: rgba(255,255,255,0.22);
  color: #ffffff;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}
.dental-chart-3d .single-jaw-svg {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  margin: 0 auto;
  padding: 8px 0;
}
.dental-chart-3d .smile-view-box {
  width: 100%;
  max-width: 620px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 6px;
}
.dental-chart-3d .dental-3d-svg,
.dental-chart-3d .dental-smile-svg {
  max-width: 620px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Hover effects & animations on 3D teeth */
.dental-chart-3d .tooth-3d-node,
.dental-chart-3d .tooth-smile-node {
  transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1), filter .2s ease;
  transform-origin: center center;
}
.dental-chart-3d .tooth-3d-node:hover,
.dental-chart-3d .tooth-smile-node:hover {
  transform: scale(1.18);
}
.dental-chart-3d .tooth-3d-node.is-restored:hover,
.dental-chart-3d .tooth-smile-node.is-restored:hover {
  filter: drop-shadow(0 0 14px rgba(16, 185, 129, 0.95)) drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

/* Tooltip bay khi hover/tap */
.dental-chart-3d .tooth-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  z-index: 20;
  max-width: 250px;
  border-left: 3px solid #10b981;
  transition: opacity .15s ease, transform .15s ease;
}
.dental-chart-3d .tooth-tooltip .tt-title {
  font-weight: 700;
  font-size: 12.5px;
  color: #6ee7b7;
  margin-bottom: 2px;
}
.dental-chart-3d .tooth-tooltip .tt-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  margin-top: 3px;
}
.dental-chart-3d .tooth-tooltip .tt-status.restored {
  background: #065f46;
  color: #a7f3d0;
}
.dental-chart-3d .tooth-tooltip .tt-status.natural {
  background: #334155;
  color: #cbd5e1;
}

/* Thanh chu thich mau (Legend Bar) */
.dental-chart-3d .chart-legend-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 18px;
  background: #f8fafc;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.dental-chart-3d .legend-badges {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 15px;
}
.dental-chart-3d .legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-2);
  font-size: 15px;
}
.dental-chart-3d .legend-pill strong {
  font-size: 15px;
}
.dental-chart-3d .swatch-porcelain {
  width: 19px;
  height: 19px;
  border-radius: 4px;
  background: linear-gradient(135deg, #a7f3d0 0%, #10b981 50%, #047857 100%);
  border: 1px solid #065f46;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.45);
}
.dental-chart-3d .swatch-natural {
  width: 19px;
  height: 19px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border: 1.5px solid #cbd5e1;
}
.dental-chart-3d .swatch-porcelain.dual-color {
  background: linear-gradient(90deg, #2563eb 0%, #2563eb 50%, #16a34a 50%, #16a34a 100%) !important;
  border: 1.5px solid #0f172a !important;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.45);
}

/* ==========================================================================
   1. SƠ ĐỒ PHIẾU CHỈ ĐỊNH LABO (Chuẩn Mẫu Hình 2)
   ========================================================================== */
.presc-chart-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
  overflow-x: auto;
  box-sizing: border-box;
}
.presc-chart-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px 28px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
.presc-jaw-header, .presc-jaw-footer {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #64748b;
  text-transform: uppercase;
}
.presc-jaw-header {
  margin-bottom: 16px;
}
.presc-jaw-footer {
  margin-top: 16px;
}
.presc-horizontal-bar {
  width: 100%;
  height: 1px;
  background: #e2e8f0;
  margin: 14px 0;
}
.presc-teeth-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0 !important;
  margin: 0 !important;
}
.presc-quad {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  align-items: center !important;
}
.presc-midline-bar {
  width: 1px !important;
  height: 52px !important;
  background: #e2e8f0 !important;
  margin: 0 14px !important;
  flex-shrink: 0 !important;
}
.presc-tooth-unit {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  width: 24px;
  cursor: pointer;
  padding: 2px 0;
  border-radius: 4px;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.presc-tooth-unit:hover {
  transform: translateY(-2px);
}
.presc-tooth-num {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  font-family: inherit;
  line-height: 1;
}
.upper-jaw .presc-tooth-num {
  margin-bottom: 8px;
}
.lower-jaw .presc-tooth-num {
  margin-top: 8px;
}
.presc-tooth-num.is-active {
  color: #0f172a;
  font-weight: 800;
  font-size: 12.5px;
}
.presc-capsule-wrap {
  line-height: 0;
  width: 24px;
  height: 46px;
}
.presc-tooth-svg {
  display: block;
  width: 24px;
  height: 46px;
  overflow: visible;
  transition: filter 0.2s;
}
.presc-tooth-svg.is-active {
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.35));
}
.presc-tooth-unit:hover .presc-tooth-svg.is-active {
  filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.55));
}
.presc-tooth-unit:hover .presc-tooth-svg.is-natural {
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.14));
}
@media (max-width: 560px) {
  .presc-chart-box {
    padding: 16px 8px;
  }
  .presc-quad {
    gap: 3px !important;
  }
  .presc-midline-bar {
    margin: 0 8px !important;
  }
}

/* ==========================================================================
   2. SƠ ĐỒ 4 PHÂN KHU CHỮ THẬP (Chuẩn Mẫu Hình 1)
   ========================================================================== */
.cross-chart-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 14px 6px;
  overflow-x: auto;
}
.cross-chart-box {
  background: #ffffff;
  border: 1px solid #dce8ea;
  border-radius: 12px;
  padding: 24px 20px;
  max-width: 720px;
  width: 100%;
  position: relative;
  box-shadow: 0 4px 16px rgba(10, 44, 53, 0.05);
}
.cross-sides-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 10px;
}
.side-label-right, .side-label-left {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}
.cross-quadrants-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  position: relative;
  border-top: 2px solid #0f172a;
  border-bottom: 2px solid #0f172a;
}
.cross-quadrants-grid::before {
  /* Đường dọc chữ thập */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2.5px;
  background: #0f172a;
  transform: translateX(-50%);
  z-index: 2;
}
.cross-divider-horizontal {
  /* Đường ngang chữ thập */
  grid-column: 1 / -1;
  height: 2.5px;
  background: #0f172a;
  margin: 0;
  z-index: 2;
}
.cross-cell {
  position: relative;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
}
.quad-cell-1, .quad-cell-4 {
  padding-right: 18px;
}
.quad-cell-2, .quad-cell-3 {
  padding-left: 18px;
}
.quad-number-watermark {
  position: absolute;
  font-size: 38px;
  font-weight: 900;
  color: #0f172a;
  opacity: 0.85;
  pointer-events: none;
  line-height: 1;
}
.quad-cell-1 .quad-number-watermark { top: 8px; left: 50%; transform: translateX(-50%); }
.quad-cell-2 .quad-number-watermark { top: 8px; left: 50%; transform: translateX(-50%); }
.quad-cell-4 .quad-number-watermark { bottom: 8px; left: 50%; transform: translateX(-50%); }
.quad-cell-3 .quad-number-watermark { bottom: 8px; left: 50%; transform: translateX(-50%); }

.cross-teeth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}
.cross-numbers-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  position: relative;
  z-index: 1;
}
.cross-numbers-row.lower {
  margin-top: 0;
  margin-bottom: 6px;
}
.cross-num {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  min-width: 20px;
  text-align: center;
}
.cross-num.is-active {
  color: #2563eb;
  font-weight: 900;
  font-size: 12.5px;
}
.cross-tooth-item {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  justify-content: center;
}
.cross-tooth-item:hover {
  transform: scale(1.15);
}
.anat-tooth-svg {
  display: block;
  overflow: visible;
  transition: filter 0.2s;
}
.cross-tooth-item.is-restored .anat-tooth-svg {
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.45));
}
.cross-tooth-item:hover .anat-tooth-svg {
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.18));
}
.cross-tooth-item.is-restored:hover .anat-tooth-svg {
  filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.55));
}

/* Ban In An (Print Certificate) */
.dental-chart-3d.is-print {
  box-shadow: none !important;
  border: 1px solid #cbd5e1 !important;
  break-inside: avoid;
}
.dental-chart-3d.is-print .chart-view-toggle {
  display: none !important;
}
@media (max-width: 600px) {
  .dental-chart-3d .chart-header { flex-direction: column; align-items: flex-start; }
  .dental-chart-3d .chart-header-actions { width: 100%; justify-content: space-between; }
}



