/* PATSADU — Thai typography (local Kanit) */
:root {
  --phadsadu-font-family: 'Kanit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-font-sans-serif: var(--phadsadu-font-family);
  --bs-body-font-family: var(--phadsadu-font-family);
}

html,
body,
.layout-wrapper,
.menu,
.navbar,
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.card,
.btn,
.form-control,
.form-select,
.dropdown-menu,
.table,
.badge,
.alert,
.modal,
.offcanvas,
.nav,
.pagination {
  font-family: var(--phadsadu-font-family);
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.app-brand-text.demo {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.app-brand-logo.demo {
  width: auto;
  height: auto;
}

.app-brand-logo.demo img.app-brand-img {
  display: block;
  height: 42px;
  width: auto;
  max-width: 168px;
  object-fit: contain;
}

/* Beat Vuexy `.app-brand-logo img { display: block }` so the icon stays hidden until collapse */
.app-brand-logo.demo img.app-brand-img-collapsed {
  display: none;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.menu-vertical.menu-collapsed:not(:hover) .app-brand-logo.demo img.app-brand-img,
.layout-menu-collapsed:not(.layout-menu-hover):not(.layout-menu-offcanvas):not(.layout-menu-fixed-offcanvas) .layout-menu .app-brand-logo.demo img.app-brand-img {
  display: none;
}

.menu-vertical.menu-collapsed:not(:hover) .app-brand-logo.demo img.app-brand-img-collapsed,
.layout-menu-collapsed:not(.layout-menu-hover):not(.layout-menu-offcanvas):not(.layout-menu-fixed-offcanvas) .layout-menu .app-brand-logo.demo img.app-brand-img-collapsed {
  display: block;
}

.phadsadu-login-logo {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
}

/* SweetAlert2 — ให้เข้ากับ Vuexy + Kanit */
.swal2-popup {
  font-family: var(--phadsadu-font-family);
  border-radius: 0.5rem;
}

.swal2-title {
  font-weight: 600;
}

body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) {
  overflow: hidden;
}

.affiliation-default-badge {
  font-size: 0.7rem;
}

/* Sidebar — เมนูยาวทั้งระบบ */
.phadsadu-sidebar-menu .menu-link div {
  white-space: normal;
  line-height: 1.35;
}

.phadsadu-sidebar-menu .menu-sub .menu-link {
  padding-inline-start: 2.75rem;
}

.phadsadu-sidebar-menu .menu-header {
  margin-top: 0.35rem;
}

/* Catalog Master — Quill + media admin */
.catalog-quill-editor {
  min-height: 180px;
  background: #fff;
}

.catalog-quill-editor .ql-editor {
  min-height: 140px;
  font-family: var(--phadsadu-font-family);
}

.catalog-media-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.catalog-media-admin-item {
  position: relative;
  border: 1px solid rgba(67, 89, 113, 0.12);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #f8f9fa;
}

.catalog-media-admin-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.catalog-media-admin-video {
  aspect-ratio: 1;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 0.7rem;
}

.catalog-media-admin-delete {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
}

.catalog-media-admin-delete .btn {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  line-height: 1;
  border-radius: 50%;
}

/* Employee E-Catalog — Shopee/TikTok style grid */
.catalog-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

@media (min-width: 1200px) {
  .catalog-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

.catalog-product-card-wrapper {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(67, 89, 113, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  height: 100%;
}

.catalog-product-card-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(67, 89, 113, 0.16);
}

.catalog-product-card-wrapper .catalog-product-card {
  box-shadow: none !important;
  transform: none !important;
  border-radius: 0;
  flex-grow: 1;
}

.catalog-product-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(67, 89, 113, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.catalog-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(67, 89, 113, 0.16);
  color: inherit;
}

.catalog-product-card-media {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(145deg, #f5f7fa, #eef1f6);
  overflow: hidden;
}

.catalog-product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-product-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a1acb8;
  font-size: 0.85rem;
}

.catalog-product-card-img--default,
.catalog-detail-gallery-img--default {
  object-fit: contain;
  background: #f5f5f9;
  padding: 1.25rem;
}

.catalog-product-badge {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
}

.catalog-product-badge--stock {
  background: rgba(40, 199, 111, 0.92);
  color: #fff;
}

.catalog-product-badge--out {
  background: rgba(234, 84, 85, 0.92);
  color: #fff;
}

.catalog-product-card-body {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.catalog-product-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-product-card-meta {
  font-size: 0.75rem;
  color: #a1acb8;
  margin: 0;
}

.catalog-product-card-stock {
  font-size: 0.8rem;
  margin: 0.35rem 0 0;
  color: #566a7f;
}

/* Product detail gallery + rich text */
.catalog-detail-gallery {
  overflow: hidden;
  border-radius: 0.75rem;
}

.catalog-detail-gallery-img {
  aspect-ratio: 1;
  object-fit: cover;
  background: #f5f7fa;
}

.catalog-detail-gallery-placeholder {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #f5f7fa, #eef1f6);
  color: #a1acb8;
  padding: 2rem;
  text-align: center;
}

.catalog-detail-indicators {
  position: static;
  margin: 0;
  padding: 0.5rem;
  gap: 0.35rem;
  display: flex;
  justify-content: center;
}

.catalog-detail-indicators button {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: none;
  background: #d9dee3;
}

.catalog-detail-indicators button.active {
  background: #696cff;
}

.catalog-rich-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #566a7f;
}

.catalog-rich-description img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.catalog-rich-description ul,
.catalog-rich-description ol {
  padding-left: 1.25rem;
}

/* Approval flow timeline */
.approval-flow-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.approval-flow-step {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
}

.approval-flow-step:last-child {
  padding-bottom: 0;
}

.approval-flow-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 0.55rem;
  top: 1.25rem;
  bottom: 0;
  width: 2px;
  background: #e7e9ed;
}

.approval-flow-marker {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  border: 2px solid #d9dee3;
  background: #fff;
  margin-top: 0.15rem;
  z-index: 1;
}

.approval-flow-step.is-active .approval-flow-marker {
  border-color: #ffab00;
  background: #fff8e1;
  box-shadow: 0 0 0 3px rgba(255, 171, 0, 0.2);
}

.approval-flow-step.is-done .approval-flow-marker {
  border-color: #71dd37;
  background: #e8fadf;
}

.approval-flow-step.is-rejected .approval-flow-marker {
  border-color: #ff3e1d;
  background: #ffe7e3;
}

.approval-flow-content {
  flex: 1;
  min-width: 0;
}

.approval-flow-step-no {
  font-size: 0.75rem;
  color: #a1acb8;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.approval-flow-signature {
  height: 36px;
  max-width: 120px;
  object-fit: contain;
}

.approval-flow-profile {
  min-width: 0;
}

.approval-flow-avatar {
  flex-shrink: 0;
  object-fit: cover;
  background: #f5f5f9;
  border: 1px solid #e7e9ed;
}

.approval-flow-empty {
  font-size: 0.875rem;
}

.approval-flow-comment {
  color: #566a7f;
  line-height: 1.45;
}