/**
 * admin.css - สไตล์เฉพาะฝั่ง Back Office (Phase 4)
 * ใช้ตัวแปรสี/ฟอนต์ร่วมกับ style.css (ของ Front Office) - หน้า admin ทุกหน้า
 * ต้อง <link> style.css ก่อนไฟล์นี้เสมอ เพื่อให้ :root variables พร้อมใช้
 */

/* ---------- Layout โครงหลัก ---------- */
body.admin-body {
  background: var(--color-bg);
  min-height: 100vh;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--color-navy);
  color: #cfd9e6;
  display: flex;
  flex-direction: column;
}

.admin-sidebar__brand {
  padding: 20px 20px 16px;
  font-weight: 800;
  color: var(--color-white);
  font-size: 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-sidebar__brand span {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: #93a3b8;
  margin-top: 2px;
}

.admin-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.admin-nav__group {
  margin-top: 8px;
  padding: 14px 20px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #8fa0b6;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-nav__group--end {
  padding: 0;
  margin-top: 8px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #cfd9e6;
  text-decoration: none;
  font-size: 14.5px;
  border-left: 3px solid transparent;
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-white);
}

.admin-nav a.is-active {
  background: rgba(255, 255, 255, 0.09);
  border-left-color: var(--color-accent);
  color: var(--color-white);
  font-weight: 600;
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  height: 60px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.admin-topbar__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-navy);
}

.admin-topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text);
}

.admin-topbar__user img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-border);
}

.admin-topbar__user .role-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.admin-content {
  flex: 1;
  padding: 24px;
}

.admin-sidebar-backdrop { display: none; }
.admin-sidebar__close { display: none; }

.admin-burger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--color-navy);
}

/* ---------- ส่วนประกอบทั่วไป ---------- */
.admin-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 20px;
}

.admin-card h2 {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--color-navy);
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.admin-stat-tile {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 18px 20px;
}

.admin-stat-tile__label {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.admin-stat-tile__value {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-navy);
}

.admin-stat-tile__sub {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.admin-stat-tile.is-warning .admin-stat-tile__value { color: var(--color-warning); }
.admin-stat-tile.is-danger .admin-stat-tile__value { color: var(--color-danger); }
.admin-stat-tile.is-success .admin-stat-tile__value { color: var(--color-success); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  padding: 8px 10px;
}

.admin-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.admin-empty {
  color: var(--color-text-muted);
  font-size: 14px;
  padding: 10px 0;
}

/* ---------- ฟอร์ม ---------- */
.admin-form-group {
  margin-bottom: 16px;
}

.admin-form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

/* เดิมลืมใส่ select/textarea/number/date/time/url ไว้ในลิสต์นี้ ทำให้ฟอร์ม
   หลังบ้านที่ใช้ field พวกนี้ (เช่น ฟอร์มตั้งราคาขายใน villa_edit.php ที่มีทั้ง
   select ประเภท markup, number ค่า markup, date วันที่มีผล) แสดงผลด้วยสไตล์
   default ของ browser เอง ไม่ตรงกับช่องอื่นๆ ในฟอร์มเดียวกัน - รวมทุก field
   type ที่ใช้จริงในระบบไว้ในที่เดียว กันตกหล่นซ้ำ */
.admin-form-group input[type="text"],
.admin-form-group input[type="email"],
.admin-form-group input[type="tel"],
.admin-form-group input[type="password"],
.admin-form-group input[type="number"],
.admin-form-group input[type="date"],
.admin-form-group input[type="time"],
.admin-form-group input[type="url"],
.admin-form-group input[type="file"],
.admin-form-group select,
.admin-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14.5px;
  background: var(--color-white);
  color: var(--color-text);
}

.admin-form-group select {
  cursor: pointer;
}

.admin-form-group textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

.admin-form-group input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-form-hint {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-top: 5px;
}

.admin-alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

.admin-alert.is-error {
  background: #fdecea;
  color: var(--color-danger);
  border: 1px solid #f6c7c4;
}

.admin-alert.is-success {
  background: #e9f8f1;
  color: var(--color-success);
  border: 1px solid #bfe9d3;
}

/* ใช้แจ้งเหตุผลตอนถูกบังคับออกจากระบบอัตโนมัติ (idle timeout / login ซ้อนจาก
   เครื่องอื่น - Change Order 20 ก.ย. 2569 ดู admin_force_logout() ) */
.admin-alert.is-info {
  background: #eaf2fb;
  color: var(--color-primary-dark);
  border: 1px solid #c3d9f2;
}

/* ---------- หน้า login ---------- */
.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--color-navy), var(--color-primary-dark));
  padding: 20px;
}

.admin-login-card {
  background: var(--color-white);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.admin-login-card__logo {
  text-align: center;
  font-weight: 800;
  font-size: 19px;
  color: var(--color-navy);
  margin-bottom: 4px;
}

.admin-login-card__sub {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* ---------- Profile ---------- */
.admin-profile-photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-border);
  display: block;
  margin-bottom: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .admin-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    overflow-y: auto;
  }

  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .admin-sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }
  body.admin-menu-open { overflow: hidden; }

  .admin-sidebar__brand { position: relative; padding-right: 56px; }
  .admin-sidebar__close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
  }
  .admin-burger { min-width: 40px; min-height: 40px; }

  .admin-burger {
    display: block;
  }

  .admin-form-row {
    grid-template-columns: 1fr;
  }

  /* ตารางข้อมูล (Booking List/คลังเอกสาร/Log ฯลฯ) เดิมไม่มี fallback อะไร
     เลยบนจอแคบ ทำให้ตารางดันเลย์เอาต์ทั้งหน้ากว้างเกินจอ/ต้อง zoom out ดู -
     แก้ด้วยเทคนิค scroll ในแนวนอนเฉพาะตัวตาราง (เนื้อหาอื่นในหน้ายังอ่านปกติ) */
  .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  /* Round 59: thead/tbody/tr are NOT forced to display:table any more - that gave every row its own column widths
     (header and rows never lined up). Left as normal table parts they share one set of columns inside the scroll box. */

  .admin-content {
    padding: 16px;
  }

  .admin-topbar {
    padding: 0 14px;
  }

  .admin-topbar__title {
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-topbar__user > div {
    display: none;
  }

  .admin-card {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .admin-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- หมายเหตุสี Back Office (Change Order 3 ต.ค. 2569) ---------- */
/* เดิม ณ จุดนี้เคยมี override ให้ Back Office คงสีฟ้า+ส้มเก่าไว้ต่างหากจาก Front
   Office (ตอนที่ลูกค้ายังไม่ confirm ขอบเขต) - ลูกค้า confirm แล้วว่าต้องการให้
   Back Office ใช้สีดำ+แดงเดียวกับ Front Office "เป๊ะๆ ทุกจุด" จึงลบ override
   ทิ้ง - admin.css ใช้ตัวแปร --color-primary/--color-accent/--color-navy ร่วมกับ
   style.css อยู่แล้วทั้งไฟล์ (ไม่มี hardcode สีฟ้า/ส้มที่อื่นอีก) ลบ block นี้
   พอแล้วหลังบ้านจะได้สีเดียวกับหน้าบ้านทันทีโดยไม่ต้องแก้จุดอื่นเพิ่ม */

/* Round 17: compact read-only calendar in villa_edit (source statuses only) */
#promotionCalendarSection .calendar__grid,
#promotionCalendarSection .calendar__nav { max-width: 560px; }
#promotionCalendarSection .calendar__day { min-height: 62px; aspect-ratio: auto; padding: 4px 2px; }
#promotionCalendarSection .calendar__day-price { font-size: 10.5px; }
#promotionCalendarSection .calendar__day-num { font-size: 15px; }
#promotionCalendarSection .calendar__day-cap { font-size: 9px; }

/* ===== Round 24b: site text editor (/admin/site_texts.php) - tabbed layout ===== */
.st-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: center; background: linear-gradient(135deg, #14233f 0%, #1d4e89 100%); color: #fff; border-radius: 16px; padding: 22px 26px; margin-bottom: 18px; box-shadow: 0 10px 30px -14px rgba(20, 35, 63, .55); }
.st-hero h2 { margin: 0 0 6px; font-size: 22px; color: #fff; }
.st-hero p { margin: 0; font-size: 13.5px; line-height: 1.6; color: rgba(255, 255, 255, .82); }
.st-hero__stats { display: flex; gap: 12px; }
.st-hero__stats > div { min-width: 96px; text-align: center; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 10px 14px; }
.st-hero__stats strong { display: block; font-size: 26px; line-height: 1.1; }
.st-hero__stats span { font-size: 12px; opacity: .85; }
.st-hero__stats .is-hot { background: #ffd24a; border-color: #ffd24a; color: #3b2a00; }
.st-hero__search { grid-column: 1 / -1; }
.st-hero__search input { width: 100%; max-width: 560px; padding: 11px 16px; border: 0; border-radius: 999px; font-size: 15px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }

.st-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 8px; background: #fff; border: 1px solid var(--color-border); border-radius: 14px 14px 0 0; border-bottom: 0; }
.st-tab { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 46px; padding: 8px 10px; border-radius: 10px; background: #f6f8fc; color: #3a4658; font-weight: 600; font-size: 14px; text-decoration: none; transition: background .15s, color .15s; }
.st-tab__name { flex: 1 1 auto; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.st-tab:hover { background: #eef3fa; }
.st-tab__icon { flex: none; font-size: 17px; line-height: 1; }
.st-tab__count { flex: none; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #e8edf5; color: #55627a; }
.st-tab__edited { flex: none; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: #fff0c2; color: #8a5a00; }
.st-tab.is-active { background: var(--color-primary, #1d4e89); color: #fff; box-shadow: 0 6px 14px -6px rgba(29, 78, 137, .65); }
.st-tab.is-active .st-tab__count { background: rgba(255, 255, 255, .22); color: #fff; }
.st-tab.is-active .st-tab__edited { background: #ffd24a; color: #3b2a00; }

.st-panels { background: #fff; border: 1px solid var(--color-border); border-radius: 0 0 14px 14px; padding: 20px 22px 0; }
.st-panels [hidden] { display: none !important; }
.st-panel__head { margin-bottom: 14px; }
.st-panel__head h3 { margin: 0 0 4px; font-size: 19px; }
.st-panel__head p { margin: 0; color: var(--color-text-muted); font-size: 13px; }
.st-panel__head a { color: var(--color-primary, #1d4e89); font-weight: 600; }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.st-row { min-width: 0; background: #f8fafd; border: 1px solid #e3e9f2; border-left: 4px solid #cbd6e6; border-radius: 12px; padding: 12px 14px 10px; transition: border-color .15s, background .15s, box-shadow .15s; }
.st-row.is-long { grid-column: 1 / -1; }
.st-row:focus-within { background: #fff; border-color: #8fb0dd; box-shadow: 0 0 0 3px rgba(29, 78, 137, .12); }
.st-row.is-changed { border-left-color: #e0a526; background: #fffbef; }
.st-row.is-dirty { border-left-color: #1d4e89; background: #f1f7ff; }
.st-row__label { min-width: 0; flex-wrap: wrap; display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 12.5px; font-weight: 700; color: #4a566b; letter-spacing: .01em; }
.st-badge { padding: 1px 8px; border-radius: 999px; background: #ffe7a3; color: #7a4f00; font-size: 11px; font-weight: 800; }
.st-row input[type=text], .st-row textarea { width: 100%; padding: 10px 12px; border: 1px solid #d4dcea; border-radius: 9px; font: inherit; font-size: 15.5px; background: #fff; box-sizing: border-box; }
.st-row input[type=text]:focus, .st-row textarea:focus { outline: none; border-color: #1d4e89; }
.st-row textarea { resize: vertical; line-height: 1.5; }
.st-row__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; }
.st-chip { padding: 2px 9px; border-radius: 999px; background: #eaf0f8; color: #4a566b; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-chip em { font-style: normal; font-weight: 600; color: #26324a; }
.st-chip--time { background: #e9f6ee; color: #1d6b43; }
.st-chip--muted { background: transparent; color: #8793a8; padding-left: 0; }
.st-reset { margin-left: auto; border: 1px solid #d6dbe6; background: #fff; color: #b3261e; border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.st-reset:hover { background: #fdecea; border-color: #f0b4ae; }
.st-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px -22px 0; padding: 12px 22px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-top: 1px solid #e3e9f2; border-radius: 0 0 14px 14px; }
.st-savebar__info { font-size: 13.5px; color: var(--color-text-muted); }
.st-savebar__info.is-dirty { color: #1d4e89; font-weight: 700; }
.st-savebar__btn { border: 0; background: linear-gradient(135deg, #e11d1d, #b91c1c); color: #fff; font-weight: 800; font-size: 15px; padding: 10px 28px; border-radius: 999px; cursor: pointer; box-shadow: 0 8px 18px -8px rgba(225, 29, 29, .6); }
.st-savebar__btn:disabled { background: #cfd6e2; box-shadow: none; cursor: not-allowed; }
.st-empty { padding: 40px 0; text-align: center; color: var(--color-text-muted); }
@media (max-width: 860px) {
  .st-hero { grid-template-columns: 1fr; padding: 18px; }
  .st-grid { grid-template-columns: minmax(0, 1fr); }
  .st-savebar__btn { white-space: nowrap; padding: 10px 20px; }
  .st-savebar__info { font-size: 12.5px; }
  .st-panels { padding: 16px 14px 0; }
  .st-savebar { margin: 16px -14px 0; padding: 10px 14px; }
  .st-tab { padding: 9px 10px; font-size: 13.5px; }
}

/* Round 25: invisible default submit (Enter key saves, never resets) */
.st-default-submit { position: absolute; width: 0; height: 0; padding: 0; margin: 0; border: 0; opacity: 0; overflow: hidden; pointer-events: none; }

/* Round 26: tabs wrap into rows (no sideways scrolling) */
@media (max-width: 1100px) { .st-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { .st-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .st-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 6px; } .st-tab { padding: 9px 8px; gap: 5px; font-size: 13px; } .st-tab__edited { display: none; } }

/* Round 26: find & replace panel */
.st-replace { background: #fff; border: 1px solid #f0d58a; border-left: 5px solid #e0a526; border-radius: 14px; margin: 0 0 16px; box-shadow: 0 6px 18px -12px rgba(224, 165, 38, .6); }
.st-replace > summary { cursor: pointer; list-style: none; padding: 14px 18px; font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: #3b2a00; }
.st-replace > summary::-webkit-details-marker { display: none; }
.st-replace > summary::after { content: "▾"; margin-left: auto; font-size: 16px; transition: transform .2s; }
.st-replace[open] > summary::after { transform: rotate(180deg); }
.st-replace > summary small { font-weight: 500; font-size: 12.5px; color: var(--color-text-muted); }
.st-replace__icon { font-size: 20px; }
.st-replace__body { padding: 0 18px 18px; }
.st-warn { background: #fff4e5; border: 1px solid #f5c26b; color: #7a3b00; border-radius: 10px; padding: 11px 14px; font-size: 13.5px; line-height: 1.65; margin-bottom: 14px; }
.st-warn b { color: #b42318; }
.st-replace__form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 220px); gap: 12px; align-items: end; }
.st-replace__field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: #4a566b; }
.st-replace__field input, .st-replace__field select { width: 100%; padding: 10px 12px; border: 1px solid #d4dcea; border-radius: 9px; font: inherit; font-size: 15px; font-weight: 400; background: #fff; box-sizing: border-box; }
.st-replace__field input:focus, .st-replace__field select:focus { outline: none; border-color: #1d4e89; box-shadow: 0 0 0 3px rgba(29, 78, 137, .14); }
.st-replace__check { grid-column: 1 / 3; display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.st-replace__btn { justify-self: end; border: 0; border-radius: 999px; padding: 11px 24px; font-weight: 800; font-size: 14.5px; color: #fff; background: linear-gradient(135deg, #1d4e89, #14233f); cursor: pointer; box-shadow: 0 8px 18px -8px rgba(20, 35, 63, .7); white-space: nowrap; }
.st-replace__result { margin-top: 16px; border-top: 1px dashed #e0c98a; padding-top: 14px; }
.st-replace__result h4 { margin: 0 0 10px; font-size: 15px; }
.st-replace__result h4 small { font-weight: 500; color: var(--color-text-muted); font-size: 13px; }
.st-replace__none { margin: 0; padding: 12px 14px; background: #f3f5f9; border-radius: 10px; color: #55627a; }
.st-replace__table { display: grid; gap: 8px; max-height: 420px; overflow: auto; padding-right: 4px; }
.st-replace__item { border: 1px solid #e3e9f2; border-radius: 10px; padding: 9px 12px; background: #fafbfd; }
.st-replace__lbl { font-size: 12.5px; font-weight: 700; color: #4a566b; margin-bottom: 5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.st-replace__lbl span { background: #e8edf5; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; }
.st-replace__lbl em { font-style: normal; font-weight: 600; color: #8a5a00; background: #fff0c2; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; }
.st-replace__diff { display: grid; gap: 3px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.st-replace__diff b { display: inline-block; min-width: 38px; font-size: 11.5px; color: #8793a8; }
.st-replace__diff .is-new { color: #14532d; }
.st-replace__diff mark { border-radius: 4px; padding: 0 2px; }
.st-replace__diff mark.old { background: #ffd9d6; color: #8a1c14; text-decoration: line-through; }
.st-replace__diff mark.new { background: #c9f1d9; color: #0e5a30; font-weight: 700; }
.st-replace__skipped { margin-top: 10px; padding: 9px 12px; background: #fff4e5; border: 1px solid #f5c26b; border-radius: 10px; font-size: 13px; color: #7a3b00; }
.st-replace__apply { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 14px; padding: 12px 14px; background: #fff1f0; border: 1px solid #f3b7b1; border-radius: 12px; }
.st-replace__confirm { flex: 1 1 320px; display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; font-weight: 600; color: #8a1c14; cursor: pointer; line-height: 1.5; }
.st-replace__confirm input { margin-top: 3px; }
.st-replace__go { border: 0; border-radius: 999px; padding: 12px 26px; font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(135deg, #e11d1d, #b91c1c); cursor: pointer; box-shadow: 0 8px 18px -8px rgba(225, 29, 29, .6); }
.st-replace__go:disabled { background: #cfd6e2; box-shadow: none; cursor: not-allowed; }
.st-replace__cancel { color: #4a566b; font-weight: 600; text-decoration: underline; }
.st-replace__note { margin: 8px 0 0; font-size: 12.5px; color: var(--color-text-muted); }
@media (max-width: 860px) {
  .st-replace__form { grid-template-columns: minmax(0, 1fr); }
  .st-replace__check { grid-column: auto; }
  .st-replace__btn { justify-self: stretch; text-align: center; }
  .st-replace__apply { flex-direction: column; align-items: stretch; }
  .st-replace__go { width: 100%; }
  .st-replace__cancel { text-align: center; }
}


/* ===== Round 59: admin lists on phones as cards (opt-in: class admin-table--cards + data-label on every td) ===== */
@media (max-width: 860px) {
  .admin-table--cards { display: block; overflow: visible; white-space: normal; }
  .admin-table--cards thead { display: none; }
  .admin-table--cards tbody { display: block; }
  .admin-table--cards tr { display: block; border: 1px solid var(--color-border); border-radius: 12px; padding: 6px 12px; margin-bottom: 12px; background: var(--color-white, #fff); }
  .admin-table--cards td { display: block; position: relative; min-height: 20px; padding: 7px 0 7px 38%; border-bottom: 1px dashed var(--color-border); white-space: normal !important; text-align: left; word-break: break-word; max-width: none !important; }
  .admin-table--cards td::before { content: attr(data-label); position: absolute; left: 0; top: 7px; width: 34%; font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
  .admin-table--cards td:last-child { border-bottom: 0; }
  .admin-table--cards td.cell-actions { display: flex !important; flex-wrap: wrap; gap: 6px; padding: 10px 0 4px; }
  .admin-table--cards td.cell-actions::before { display: none; }
  .admin-table--cards td.cell-actions > div { display: flex !important; flex-wrap: wrap; gap: 6px; width: 100%; justify-content: stretch !important; }
  .admin-table--cards td.cell-actions form { flex: 1 1 100%; }
  .admin-table--cards td.cell-actions .btn { flex: 1 1 auto; justify-content: center; }
  .admin-table--cards td.cell-actions select { width: 100%; }
}
