﻿/* =========================================================
   HD Diamonds Dental Lab – trang quản trị
   ========================================================= */
:root {
  --brand: #0d4aa6;
  --brand-dark: #0a3478;
  --brand-navy: #06204d;
  --brand-soft: #eaf1fb;
  --line: #e3e9f2;
  --sidebar-w: 250px;
}

body {
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: .92rem;
  background: #f3f6fb;
  color: #16243a;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn-outline-primary {
  color: var(--brand);
  border-color: var(--brand);
}

.btn-outline-primary:hover {
  background: var(--brand);
  border-color: var(--brand);
}

a {
  color: var(--brand);
}

/* ---------- Khung ---------- */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  flex-direction: column;
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand-navy) 0%, #041633 100%);
  color: #fff;
}

aside.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
}

.offcanvas.admin-sidebar {
  width: var(--sidebar-w);
}

.admin-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.admin-brand img {
  height: 44px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 1rem .75rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .9rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}

.admin-nav-link i {
  font-size: 1.05rem;
}

.admin-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
}

.admin-nav-link.active {
  color: #fff;
  background: var(--brand);
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.admin-page-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.admin-content {
  padding: 1.5rem;
}

@media (max-width: 575.98px) {
  .admin-content {
    padding: 1rem;
  }
}

/* ---------- Thành phần ---------- */
.admin-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(6, 32, 77, .04);
  overflow: hidden;
}

.admin-card .card-header {
  background: #fff;
  font-weight: 600;
  padding: .9rem 1.25rem;
}

.admin-card .table th {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #5d6b80;
  background: #f8fafd;
  white-space: nowrap;
}

.admin-card .table td,
.admin-card .table th {
  padding: .75rem 1rem;
}

.table-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--brand-soft);
}

.photo-thumb {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: box-shadow .2s ease, transform .2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(6, 32, 77, .08);
}

.stat-card-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.35rem;
}

.stat-card strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1.1;
}

.stat-card small {
  color: #5d6b80;
}

.admin-tabs .nav-link {
  color: #5d6b80;
  font-weight: 500;
}

.admin-tabs .nav-link.active {
  color: var(--brand);
}

.image-input-box {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
}

.image-input-preview {
  width: 120px;
  height: 90px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--brand-soft);
}

.article-editor {
  min-height: 360px;
  font-size: 1rem;
}

.ql-toolbar.ql-snow {
  border-radius: 10px 10px 0 0;
}

.ql-container.ql-snow {
  border-radius: 0 0 10px 10px;
}

/* ---------- Thẻ bảo hành: chọn kiểu thẻ + trình đặt vị trí trên ảnh thẻ mẫu ---------- */
.layout-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
}

.layout-option {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.layout-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
}

.layout-option input {
  margin-top: .25rem;
}

.layout-option small {
  display: block;
  color: #6b7280;
  line-height: 1.4;
}

.ctpl-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 991.98px) {
  .ctpl-workspace {
    grid-template-columns: 1fr;
  }
}

.ctpl-stage {
  user-select: none;
  touch-action: none;
}

.ctpl-stage .wcard-tpl-field {
  cursor: move;
  outline: 1px dashed rgba(13, 74, 166, .55);
  outline-offset: 1px;
  background: rgba(255, 255, 255, .25);
}

.ctpl-stage .wcard-tpl-field.is-selected {
  outline: 2px solid #f59e0b;
  background: rgba(245, 158, 11, .15);
  z-index: 1;
}

/* Sơ đồ răng không có kích thước riêng: viền từng góc + chấm đánh dấu tâm chữ thập */
.ctpl-stage .wcard-tpl-chart,
.ctpl-stage .wcard-tpl-chart.is-selected {
  outline: none;
  background: none;
}

.ctpl-stage .wcard-tpl-chart::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(13, 74, 166, .8);
}

.ctpl-stage .wcard-tpl-chart > span {
  outline: 1px dashed rgba(13, 74, 166, .55);
  background: rgba(255, 255, 255, .25);
}

.ctpl-stage .wcard-tpl-chart.is-selected::before {
  background: #f59e0b;
}

.ctpl-stage .wcard-tpl-chart.is-selected > span {
  outline: 2px solid #f59e0b;
  background: rgba(245, 158, 11, .15);
}

.ctpl-stage .wcard-tpl-field:focus-visible {
  outline: 2px solid #f59e0b;
}

.ctpl-empty {
  display: grid;
  place-items: center;
  gap: .5rem;
  min-height: 220px;
  padding: 1.5rem;
  border: 2px dashed var(--line);
  border-radius: 12px;
  color: #6b7280;
  text-align: center;
}

.ctpl-empty .bi {
  font-size: 2rem;
}

.ctpl-panel {
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
}

.ctpl-panel-title {
  margin-bottom: .5rem;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #6b7280;
}

.ctpl-add,
.ctpl-placed {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .9rem;
}

.ctpl-add .btn,
.ctpl-placed .btn {
  --bs-btn-padding-y: .15rem;
  --bs-btn-padding-x: .45rem;
  --bs-btn-font-size: .78rem;
}

.ctpl-placed:empty {
  display: none;
}

.ctpl-props {
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}

.ctpl-prop {
  display: block;
  margin-bottom: .5rem;
  font-size: .85rem;
}

.ctpl-prop > span {
  display: flex;
  justify-content: space-between;
}

.ctpl-prop small {
  display: block;
  line-height: 1.3;
}

/* ---------- Đăng nhập ---------- */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1rem;
  background:
    radial-gradient(circle at 80% 20%, rgba(59, 140, 240, .25), transparent 50%),
    linear-gradient(140deg, var(--brand-navy) 0%, #0b3270 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.25rem 2rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
}

.login-logo {
  display: block;
  height: 56px;
  margin: 0 auto 1.25rem;
}

/* ---------- Trang cài đặt website ---------- */
.settings-nav {
  position: sticky;
  top: 80px;
}

.settings-nav .nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .85rem;
  color: #3b4a60;
  text-align: left;
  border-radius: 10px;
}

.settings-nav .nav-link.active {
  background: var(--brand);
  color: #fff;
}

.settings-search-icon {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8a97a8;
}

.settings-content.searching .tab-pane {
  display: none;
}

.settings-content.searching .tab-pane.search-hit {
  display: block;
  opacity: 1;
  margin-bottom: 1rem;
}

.content-field .form-label {
  font-weight: 500;
}

.icon-preview {
  min-width: 46px;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--brand);
}

.settings-savebar {
  position: sticky;
  bottom: 0;
  z-index: 1010;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 1.5rem -1.5rem -1.5rem;
  padding: .85rem 1.5rem;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(6, 32, 77, .05);
}

/* Logo / favicon: hiển thị trọn vẹn, logo trắng đặt trên nền tối */
.image-input-preview.is-logo {
  object-fit: contain;
  padding: .5rem;
  background: #fff;
}

.image-input-preview.on-dark {
  background: var(--brand-navy);
}

/* Bản đồ xem trước trong trang cài đặt */
.map-preview {
  height: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef2f7;
}

.map-preview iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Chọn tông màu website ---------- */
.theme-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: .6rem;
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .5rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  transition: border-color .15s ease, transform .15s ease;
}

.theme-swatch:hover {
  transform: translateY(-2px);
  border-color: #c3ccd8;
}

.theme-swatch.active {
  border-color: #16243a;
  box-shadow: 0 0 0 3px rgba(22, 36, 58, .12);
}

.theme-swatch-colors {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  height: 28px;
  overflow: hidden;
  border-radius: 7px;
}

.theme-swatch-name {
  font-size: .78rem;
  font-weight: 600;
  color: #3b4a60;
}

.theme-swatch.active .theme-swatch-name::after {
  content: " ✓";
}

.settings-content.searching .theme-picker,
.settings-content.searching .template-picker {
  display: none;
}

/* ---------- Chọn mẫu bố cục trang chủ (hình phác hoạ dùng màu chủ đạo --brand) ---------- */
.template-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .6rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}

.template-card:hover {
  transform: translateY(-2px);
  border-color: #c3ccd8;
}

.template-card.active {
  border-color: #16243a;
  box-shadow: 0 0 0 3px rgba(22, 36, 58, .12);
}

.template-card:focus-within {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.template-card-name {
  font-size: .9rem;
  font-weight: 700;
  color: #16243a;
}

.template-card.active .template-card-name::after {
  content: " ✓";
}

.template-card-desc {
  font-size: .75rem;
  line-height: 1.4;
  color: #6b7a90;
}

/* Hình phác hoạ (sinh từ định nghĩa mẫu): banner + 2 khối; dải chữ (i, b = nút), ảnh, thẻ, dải tối */
.tw {
  --tw-r: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 132px;
  padding: 7px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e3e8ef;
}

.tw-c-round { --tw-r: 8px; }
.tw-c-sharp { --tw-r: 1px; }

.tw-part {
  display: flex;
  gap: 5px;
  flex: 1;
  min-height: 0;
  border-radius: 3px;
}

.tw-hero { flex: 1.5; }

.tw-row { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
.tw-col { flex-direction: column; justify-content: center; }
.tw-center { align-items: center; justify-content: center; }

.tw-soft {
  margin-inline: -7px;
  padding: 3px 7px;
  background: color-mix(in srgb, var(--brand) 8%, white);
}

.tw-bg-tinted .tw-soft { background: color-mix(in srgb, var(--brand) 16%, white); }

.tw-bg-lines .tw-part + .tw-part:not(.tw-dark) {
  border-top: 1px solid #dfe5ed;
  border-radius: 0;
  padding-top: 4px;
}

.tw-dark {
  margin-inline: -7px;
  padding: 4px 7px;
  border-radius: 0;
  background: linear-gradient(90deg, var(--brand-navy, #06204d), color-mix(in srgb, var(--brand-navy, #06204d) 70%, var(--brand)));
}

.tw-hero.tw-dark {
  margin-top: -7px;
  align-items: center;
  background:
    linear-gradient(90deg, var(--brand-navy, #06204d) 0%, color-mix(in srgb, var(--brand-navy, #06204d) 55%, transparent) 70%, transparent),
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 40%, white), color-mix(in srgb, var(--brand) 75%, white));
}

.tw-hero.tw-dark.tw-center {
  flex-direction: column;
  background: linear-gradient(180deg, var(--brand-navy, #06204d), color-mix(in srgb, var(--brand-navy, #06204d) 80%, var(--brand)));
}

.tw-lines {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.tw-lines.center { align-items: center; width: 100%; }
.tw-lines.w55 { width: 55%; }
.tw-lines.w70 { width: 70%; }

.tw-lines i,
.tw-lines b {
  display: block;
  height: 4px;
  width: 100%;
  border-radius: 2px;
  background: #c8d1dd;
}

.tw-lines.big i { height: 7px; background: #9aa8ba; }
.tw-lines i.w50 { width: 50%; }
.tw-lines i.w60 { width: 60%; }
.tw-lines i.w70 { width: 70%; }

.tw-lines b {
  width: 34%;
  height: 6px;
  border-radius: var(--tw-r);
  background: var(--brand);
}

.tw-lines.light i { background: rgba(255, 255, 255, .7); }

.tw-img,
.tw-wide,
.tw-cards > span,
.tw-list > span {
  border-radius: var(--tw-r);
}

.tw-img,
.tw-wide {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 35%, white), color-mix(in srgb, var(--brand) 65%, white));
}

.tw-img { align-self: stretch; min-height: 0; }

.tw-wide { flex: 1; min-height: 8px; width: 100%; }
.tw-wide.thin { flex: none; height: 12px; }

.tw-row2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 6px; align-items: end; }

.tw-boxed { position: relative; flex-direction: column; }
.tw-wide.tall { flex: 1; }

.tw-card {
  position: absolute;
  left: 7px;
  bottom: 3px;
  width: 48%;
  padding: 4px 5px;
  border-radius: var(--tw-r);
  background: #fff;
  box-shadow: 0 3px 8px rgba(6, 32, 77, .18);
}

.tw-search {
  width: 70%;
  height: 9px;
  margin-top: 3px;
  border-radius: 999px;
  background: #fff;
}

.tw-search.light { border: 1px solid #c8d1dd; }

.tw-cards { display: grid; gap: 5px; }
.tw-cards.h { grid-template-columns: 1fr 1fr; }
.tw-cards.three { grid-template-columns: repeat(3, 1fr); }
.tw-cards.four { grid-template-columns: repeat(4, 1fr); }

.tw-cards > span {
  border: 1px solid #d9e0ea;
  background: #fff;
}

.tw-cards.v > span { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 30%, white) 0 55%, #fff 55%); }
.tw-cards.h > span { background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 30%, white) 0 45%, #fff 45%); }

.tw-cards.tiles > span {
  border: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 35%, white) 0 45%, var(--brand-navy, #06204d) 100%);
}

.tw-list { flex-direction: column; justify-content: center; gap: 4px; }

.tw-list > span {
  flex: 1;
  border: 1px solid #d9e0ea;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 30%, white) 0 16%, #fff 16% 80%, color-mix(in srgb, var(--brand) 60%, white) 80% 92%, #fff 92%);
}

.tw-dots { align-items: center; justify-content: space-evenly; }

.tw-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
}
/* ---------- Chọn màu thẻ bảo hành (màu của từng ô lấy từ --c) ---------- */
.ccp-current {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}

.ccp-preview {
  flex-shrink: 0;
  width: 56px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  /* Giống họa tiết thẻ: nền nhạt pha màu + vạch chéo đậm */
  background:
    linear-gradient(115deg, transparent 0 40%, color-mix(in srgb, var(--c, #cfd6e0) 35%, transparent) 40% 60%, transparent 60%),
    linear-gradient(135deg, #fff, color-mix(in srgb, var(--c, #cfd6e0) 30%, white));
  box-shadow: inset 0 -4px 0 var(--c, #cfd6e0);
}

.ccp-group-title {
  margin: .7rem 0 .35rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6b7a90;
}

.ccp-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: .35rem;
}

.ccp-swatch,
.ccp-empty {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  padding: .3rem .45rem;
  border: 2px solid transparent;
  border-radius: 9px;
  background: #f6f8fb;
  font-size: .78rem;
  font-weight: 600;
  color: #3b4a60;
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
}

.ccp-swatch::before {
  content: "";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

.ccp-swatch span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ccp-swatch:hover,
.ccp-empty:hover {
  background: #eef2f7;
}

.ccp-swatch.active,
.ccp-empty.active {
  border-color: #16243a;
  background: #fff;
}

.ccp-custom {
  max-width: 260px;
}

/* Form phiếu bảo hành: màu thẻ lấy theo sản phẩm đang chọn */
.card-color-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .4rem;
  font-size: .85rem;
}

.ccp-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}

.ccp-dot.is-empty {
  background: repeating-linear-gradient(45deg, #e3e8ef 0 3px, #fff 3px 6px);
}

/* Xem trước tông màu (màu lấy từ --p-primary / --p-dark / --p-navy do script gán) */
.theme-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: .78rem;
  max-width: 560px;
}

.theme-preview-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .8rem;
  background: #fff;
  border-bottom: 1px solid #eef1f5;
}

.theme-preview-logo {
  width: 54px;
  height: 14px;
  border-radius: 4px;
  background: var(--p-primary);
}

.theme-preview-menu {
  display: flex;
  gap: .4rem;
  flex: 1;
}

.theme-preview-menu b,
.theme-preview-menu i {
  width: 32px;
  height: 6px;
  border-radius: 3px;
  background: #d5dbe3;
}

.theme-preview-menu b {
  background: var(--p-primary);
}

.theme-preview-pill {
  padding: .2rem .6rem;
  border-radius: 999px;
  background: var(--p-primary);
  color: #fff;
  font-weight: 600;
}

.theme-preview-body {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .9rem .8rem;
  background: linear-gradient(110deg, #fff 0%, color-mix(in srgb, var(--p-primary) 9%, white) 100%);
}

.theme-preview-eyebrow {
  color: var(--p-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .68rem;
}

.theme-preview-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--p-navy);
}

.theme-preview-title em {
  font-style: normal;
  color: var(--p-primary);
}

.theme-preview-btn {
  padding: .3rem .8rem;
  border-radius: 999px;
  background: var(--p-primary);
  border: 1px solid var(--p-primary);
  color: #fff;
  font-weight: 600;
}

.theme-preview-btn.outline {
  background: #fff;
  color: var(--p-primary);
}

.theme-preview-footer {
  padding: .6rem .8rem;
  background: linear-gradient(160deg, var(--p-navy) 0%, color-mix(in srgb, var(--p-navy) 70%, black) 100%);
  color: rgba(255, 255, 255, .8);
}

/* ---------- Thành phần Bootstrap theo màu thương hiệu ---------- */
.text-primary {
  color: var(--brand) !important;
}

.form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: color-mix(in srgb, var(--brand) 50%, white);
  box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 25%, transparent);
}

.page-link {
  color: var(--brand);
}

.page-item.active .page-link {
  background-color: var(--brand);
  border-color: var(--brand);
}

.btn-outline-primary:active,
.btn-check:checked + .btn-outline-primary {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
}

/* ---------- Ô chọn ảnh: khung xem trước đúng tỉ lệ + kiểm tra kích thước ---------- */
.image-frame {
  position: relative;
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef1f5;
}

.image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Logo, favicon: hiện trọn ảnh trên nền caro để thấy rõ phần trong suốt */
.image-frame.is-contain {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #f0f2f5 25%, transparent 25%), linear-gradient(-45deg, #f0f2f5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0f2f5 75%), linear-gradient(-45deg, transparent 75%, #f0f2f5 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}

.image-frame.is-contain img {
  object-fit: contain;
  padding: 6px;
}

.image-frame.on-dark {
  background: var(--brand-navy);
}

.image-spec {
  margin-bottom: .4rem;
  font-size: .82rem;
  color: #3b4a60;
}

.image-spec .bi {
  color: var(--brand);
}

.image-check {
  margin-top: .4rem;
  font-size: .8rem;
  line-height: 1.45;
}

.image-check:empty {
  display: none;
}

.image-check-summary {
  color: #3b4a60;
}

.image-check-ok { color: #198754; }
.image-check-info { color: #0b6b8a; }
.image-check-warn { color: #9a6700; }
.image-check-error { color: #b42318; font-weight: 600; }

.min-w-0 {
  min-width: 0;
}

/* Cột hẹp (form sản phẩm, bài viết): phần chữ xuống dưới khung ảnh */
.image-input-box {
  flex-wrap: wrap;
}

.image-input-box > .flex-grow-1 {
  min-width: 220px;
}
/* ---------- Sơ đồ chọn răng (hệ FDI) ---------- */
.tooth-picker {
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfd;
  overflow-x: auto;
}

.tooth-picker-sides,
.tooth-picker-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .75rem;
  color: #6b778a;
  padding-left: 72px;
}

.tooth-picker-actions {
  margin-top: .4rem;
}

.tooth-row {
  display: grid;
  grid-template-columns: 64px 1fr 1fr;
  align-items: center;
  min-width: 520px;
}

.tooth-row + .tooth-row .tooth-quadrant {
  border-top: 2px solid #16243a;
}

.tooth-row-name {
  font-size: .75rem;
  font-weight: 600;
  color: #3b4a60;
}

.tooth-quadrant {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  padding: 6px;
}

.tooth-quadrant:first-of-type {
  border-right: 2px solid #16243a;
}

.tooth {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .3rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  line-height: 1.1;
  color: #16243a;
  transition: all .15s ease;
}

.tooth small {
  font-size: .62rem;
  font-weight: 500;
  color: #8a97a8;
}

.tooth:hover {
  border-color: var(--brand);
}

.tooth.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.tooth.active small {
  color: rgba(255, 255, 255, .8);
}

/* ---------- Nhập Excel ---------- */
.step-badge {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: .35rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
}

.import-preview {
  max-height: 560px;
}

.import-preview thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.text-warning-dark { color: #9a6700; }
.text-info-dark { color: #0b6b8a; }

/* Đã có kết quả xem trước: khung tải file thu gọn thành 1 hàng */
@media (min-width: 992px) {
  .import-upload-compact {
    display: grid;
    grid-template-columns: 1fr auto 1.4fr;
    gap: 1rem 1.5rem;
    align-items: center;
  }

  .import-upload-compact > p,
  .import-upload-compact > hr {
    display: none;
  }

  .import-upload-compact form {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
  }

  .import-upload-compact form > * {
    margin: 0 !important;
  }

  .import-upload-compact form .form-control {
    flex: 1;
    min-width: 200px;
  }

  .import-upload-compact form .btn {
    width: auto !important;
  }

  .import-upload-compact form .form-text {
    flex-basis: 100%;
  }
}

.template-card-preview {
  margin-top: auto;
  padding-top: .25rem;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
}
