/* หลังบ้าน MY Lucky Plus+ — ตัวหนังสือใหญ่ ปุ่มใหญ่ ใช้บนมือถือได้ */

.adm { background: #f3f1ec; padding-bottom: 60px; }
.adm h1 { font-size: clamp(24px, 3.6vw, 33px); margin-bottom: .25em; }
.adm h2 { font-size: clamp(18px, 2.2vw, 21px); margin-bottom: .6em; }
.adm .muted { color: var(--text-3); font-size: 15px; }

.adm-top {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--ink-900); color: var(--on-dark);
  padding: 10px clamp(14px, 3vw, 28px); position: sticky; top: 0; z-index: 40;
}
.adm-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 600; margin-right: auto; }
.adm-brand img { border-radius: 8px; }
.adm-top__right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-link, .adm-logout {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(244, 241, 233, .1); color: var(--on-dark); border: 0;
  padding: 8px 14px; border-radius: 999px; font: inherit; font-size: 14.5px;
  text-decoration: none; cursor: pointer;
}
.adm-link:hover, .adm-logout:hover { background: rgba(244, 241, 233, .18); }
.adm-link svg, .adm-logout svg { width: 17px; height: 17px; }
.adm-user { font-size: 14.5px; color: var(--on-dark-2); }

.adm-nav {
  display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--ink-800); padding: 0 clamp(10px, 3vw, 24px);
  position: sticky; top: 58px; z-index: 39;
}
.adm-nav a {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 14px 16px; text-decoration: none; color: var(--on-dark-2);
  font-size: 15.5px; font-weight: 500; border-bottom: 3px solid transparent;
}
.adm-nav a:hover { color: var(--on-dark); }
.adm-nav a[aria-current='page'] { color: var(--gold-300); border-bottom-color: var(--gold-400); }
.adm-nav a svg { width: 19px; height: 19px; }
.adm-nav .dot {
  background: var(--danger); color: #fff; font-size: 12px; font-weight: 700;
  min-width: 21px; height: 21px; border-radius: 999px; display: inline-grid; place-items: center; padding: 0 5px;
}

.adm-main { max-width: 1120px; margin: 0 auto; padding: clamp(20px, 4vw, 34px) clamp(14px, 3vw, 28px); }

.page-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 22px; }
.page-head > div:first-child { margin-right: auto; }

.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 26px; }
@media (min-width: 700px) { .stat-row { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .stat-row { grid-template-columns: repeat(6, 1fr); } }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 14px; text-decoration: none; color: inherit; display: block;
  transition: transform .2s var(--ease), border-color .2s;
}
.stat:hover { transform: translateY(-2px); border-color: var(--gold-500); }
.stat b { display: block; font-size: 30px; line-height: 1.4; }
.stat span { font-size: 14px; color: var(--text-3); line-height: 1.45; display: block; }
.stat--urgent { border-color: var(--danger); background: #fff5f4; }
.stat--urgent b { color: var(--danger); }
.stat--warn { border-color: #e3c384; background: var(--warn-bg); }
.stat--warn b { color: var(--warn); }

.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: clamp(16px, 3vw, 26px); margin-bottom: 22px;
}
.panel__head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.panel__head h2 { margin: 0; margin-right: auto; }
.panel--danger { border-color: #eec3c0; background: #fffaf9; }

.two-col { display: grid; gap: 20px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1.15fr 1fr; align-items: start; } }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar input, .toolbar select { min-height: 46px; }

.tag {
  display: inline-block; font-size: 14px; line-height: 1.5; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; white-space: nowrap; margin-left: 6px;
}
.tag--available, .tag--inq-won { background: #e4f2e9; color: var(--ok); }
.tag--reserved, .tag--inq-appointment { background: var(--warn-bg); color: var(--warn); }
.tag--sold, .tag--inq-lost { background: #f2efe9; color: var(--text-3); }
.tag--hidden { background: #eceaf3; color: #4b4370; }
.tag--warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #e8cf9d; }
.tag--inq-new { background: #fdeceb; color: var(--danger); }
.tag--inq-contacted { background: #e7eefb; color: #24509b; }

.ph-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.ph-list li {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center;
  padding: 12px 14px; background: var(--warn-bg); border: 1px solid #ecd2a6; border-radius: 10px;
}
.ph-list a { font-weight: 600; color: inherit; }
.ph-list em {
  font-style: normal; font-size: 14px; line-height: 1.5; background: #fff; border: 1px solid #e0cfa8;
  padding: 2px 9px; border-radius: 999px; margin-right: 5px; display: inline-block;
}

.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 16px; }
.timeline li::before {
  content: ''; position: absolute; left: -25px; top: 7px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--gold-400); border: 2px solid #fff;
}
.timeline b { display: block; }
.timeline span { font-size: 14px; line-height: 1.5; }
.timeline p { margin: 4px 0 0; font-size: 15px; white-space: pre-wrap; }

/* รูปรถ */
.img-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
@media (min-width: 700px) { .img-list { grid-template-columns: repeat(4, 1fr); } }
.img-item { margin: 0; background: var(--surface-2); border-radius: 10px; overflow: hidden; cursor: grab; }
.img-item.dragging { opacity: .45; }
.img-item.drop-target { outline: 3px solid var(--gold-400); outline-offset: 2px; }
.img-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.img-item figcaption { padding: 8px; display: grid; gap: 8px; }
.img-item input { min-height: 40px; font-size: 14px; padding: 7px 10px; }

.upload-zone {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 18px; border: 2px dashed var(--line); border-radius: 12px; background: var(--surface-2);
}
.upload-status { margin-top: 12px; display: grid; gap: 8px; }
.upload-status .row { font-size: 14.5px; display: flex; gap: 8px; align-items: center; }
.upload-status .row.err { color: var(--danger); }
.upload-status .row.ok { color: var(--ok); }

/* กล่องครอปรูป */
.crop-modal {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(12, 12, 14, .78); padding: 16px;
}
.crop-modal[hidden] { display: none !important; }
.crop-box {
  background: #fff; border-radius: 16px; padding: 20px; width: min(560px, 100%);
  max-height: 92vh; overflow: auto;
}
.crop-box h2 { margin-bottom: 6px; }
.crop-stage {
  position: relative; margin: 14px 0; background: #17171b; border-radius: 10px; overflow: hidden;
  aspect-ratio: 4 / 3; touch-action: none; cursor: move;
}
.crop-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crop-hint { font-size: 14.5px; color: var(--text-3); }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; }
.crop-zoom input[type='range'] { flex: 1; min-height: 0; }

.login-card {
  background: #fff; border-radius: 18px; padding: clamp(26px, 5vw, 40px);
  width: min(430px, 100%); box-shadow: var(--shadow-2); text-align: center;
}
.adm--login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--ink-900); }
.login-card img { margin: 0 auto 16px; border-radius: 14px; }
.login-card h1 { font-size: 25px; margin-bottom: 4px; }
.login-card .form-grid { text-align: left; margin-top: 18px; }
.adm .price-table { min-width: 620px; }
.adm .price-table a { font-weight: 600; }

/* เลือกกลุ่มรถแบบติ๊กได้หลายกลุ่ม */
.checkset { border: 0; padding: 0; margin: 0 0 16px; }
.checkset legend { font-size: 14.5px; font-weight: 600; color: var(--text-2); padding: 0; margin-bottom: 8px; }
.checkset__grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .checkset__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .checkset__grid { grid-template-columns: repeat(3, 1fr); } }
.checkitem {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; font-size: 15.5px;
  transition: border-color .18s, background-color .18s;
}
.checkitem:hover { border-color: var(--gold-500); }
.checkitem input { width: 20px; height: 20px; min-height: 0; flex: none; accent-color: var(--gold-500); margin: 0; }
.checkitem:has(input:checked) { border-color: var(--gold-500); background: var(--gold-soft); font-weight: 600; }

/* หน้าแก้ข้อความในเว็บ */
.content-editor { display: grid; gap: 14px; }
.cgroup { padding: 0; margin: 0; }
.cgroup summary {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 18px clamp(16px, 3vw, 26px); font-weight: 600; font-size: 17px;
  list-style: none; border-radius: 14px;
}
.cgroup summary::-webkit-details-marker { display: none; }
.cgroup summary::after {
  content: ''; width: 10px; height: 10px; margin-left: auto; flex: none;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg); transition: transform .2s var(--ease);
}
.cgroup[open] summary::after { transform: rotate(-135deg); }
.cgroup summary em {
  font-style: normal; font-size: 14px; font-weight: 500; color: var(--text-3); white-space: nowrap;
}
.cgroup summary:hover { background: var(--surface-2); }
.cgroup__body {
  display: grid; gap: 18px;
  padding: 4px clamp(16px, 3vw, 26px) clamp(18px, 3vw, 26px);
  border-top: 1px solid var(--line);
}
.cfield { display: grid; gap: 7px; }
.cfield label {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 15px; font-weight: 600; color: var(--text-2);
}
.cfield label .tag { margin-left: 0; }
.cfield__foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 24px; }
.cfield__status { font-size: 14px; margin-left: auto; }
.cfield__status.is-saving { color: var(--text-3); }
.cfield__status.is-ok { color: var(--ok); font-weight: 600; }
.cfield__status.is-err { color: var(--danger); font-weight: 600; }
.cfield__reset {
  background: none; border: 0; padding: 6px 0; font: inherit; font-size: 14px;
  color: var(--text-3); text-decoration: underline; cursor: pointer;
}
.cfield__reset:hover { color: var(--danger); }
.cfield__reset[hidden] { display: none; }
