/* ============================================================
   ระบบแจ้งซ่อม IT — หน้า "ประวัติการแจ้งซ่อม" (ผู้ใช้ภายนอก)
   Modern Glass: การ์ดกระจก สีสถานะ gradient, แถบความคืบหน้าเรืองแสง
   ============================================================ */

body.my-page .my-head {
  max-width: 680px;
  margin: 26px auto 0;
  padding: 0 16px;
}

body.my-page .my-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  color: var(--tk-ink);
  padding-left: 14px;
  border-left: 5px solid transparent;
  border-image: linear-gradient(180deg, #00c97d, #00965b) 1;
  border-image-slice: 1;
  border-radius: 0;
  line-height: 1.4;
}

body.my-page .my-title::after {
  content: "ระบบบันทึกการแจ้งซ่อมอุปกรณ์ IT";
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--tk-muted);
  border-left: none;
}

body.my-page .my-wrap {
  max-width: 680px;
  margin: 16px auto 0;
  padding: 0 16px calc(120px + env(safe-area-inset-bottom));
}

/* ---------- รายการ ---------- */
body.my-page .my-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.my-page .mt-card {
  position: relative;
  background: var(--tk-card);
  border: 1px solid var(--tk-glass-line);
  border-radius: 22px;
  box-shadow: var(--tk-shadow);
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  animation: mtRise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 0.18s ease, box-shadow 0.24s ease;
}
@keyframes mtRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
body.my-page .mt-card:hover { transform: translateY(-3px); box-shadow: var(--tk-shadow-pop); }
body.my-page .mt-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #00c97d, #00965b);
  border-radius: 22px 0 0 22px;
}

body.my-page .mt-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 16px 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s ease;
}

body.my-page .mt-card-head { background: rgba(240, 250, 245, 0.6); }

body.my-page .mt-card-head:hover { background: rgba(215, 255, 236, 0.6); }

body.my-page .mt-head-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

body.my-page .mt-no {
  font-family: Consolas, monospace;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--tk-green-deep);
}

body.my-page .mt-date {
  font-size: 13.5px;
  color: var(--tk-muted);
}

body.my-page .mt-stamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.my-page .mt-stamp.st-new { background: linear-gradient(135deg, #ffe8b8, #ffd98a); color: #8a5a08; }
body.my-page .mt-stamp.st-working { background: linear-gradient(135deg, #c9d9ff, #a9c2ff); color: #1d3d9b; }
body.my-page .mt-stamp.st-done { background: linear-gradient(135deg, #b9f7da, #8ef0c4); color: #0a6a3e; }

body.my-page .mt-chev {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--tk-muted);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

body.my-page .mt-card.is-open .mt-chev { transform: rotate(180deg); }

body.my-page .mt-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  border-top: 1px solid transparent;
  margin: 0 18px;
}

body.my-page .mt-card.is-open .mt-body {
  border-top-width: 1px;
  border-top-color: var(--tk-line-soft);
  margin-top: 14px;
  padding-bottom: 4px;
}

body.my-page .mt-card:not(.is-open) .mt-body {
  border-top-width: 0;
}

body.my-page .mt-row {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  font-size: 15.5px;
  line-height: 1.55;
}

body.my-page .mt-row + .mt-row { border-top: 1px solid var(--tk-line-soft); }

body.my-page .mt-k {
  flex: 0 0 100px;
  color: var(--tk-muted);
  font-size: 14px;
}

body.my-page .mt-v { flex: 1; min-width: 0; word-break: break-word; white-space: pre-line; }

body.my-page .mt-msg { color: var(--tk-ink); }

/* ---------- รูปภาพที่แนบ ---------- */
body.my-page .mt-row-photos { align-items: flex-start; }

body.my-page .mt-photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

body.my-page .mt-photo {
  position: relative;
  display: block;
  width: 68px;
  height: 68px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--tk-glass-line);
  background: rgba(240, 247, 243, 0.8);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(14, 72, 44, 0.08);
  transition: transform 0.16s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}

body.my-page .mt-photo:hover { border-color: var(--tk-green); transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 18px rgba(0, 150, 91, 0.18); }
body.my-page .mt-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

body.my-page .mt-photo-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 40, 26, 0.5);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  backdrop-filter: blur(2px);
}

/* ---------- สถานะ : แถบความคืบหน้า ---------- */
body.my-page .mt-prog {
  margin-top: 14px;
  padding: 14px 14px 10px;
  border-radius: 16px;
  border: 1px solid var(--tk-glass-line);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.my-page .mt-prog.st-new { --prog-c: #b0701a; --prog-glow: rgba(176, 112, 26, 0.35); }
body.my-page .mt-prog.st-working { --prog-c: #1d4ed8; --prog-glow: rgba(29, 78, 216, 0.35); }
body.my-page .mt-prog.st-done { --prog-c: #00b26a; --prog-glow: rgba(0, 150, 91, 0.4); }

body.my-page .mt-prog-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(13, 90, 55, 0.10);
  overflow: visible;
}

body.my-page .mt-prog-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--p, 0%);
  border-radius: 999px;
  background: var(--prog-c);
  background: linear-gradient(90deg, color-mix(in srgb, var(--prog-c) 78%, #fff), var(--prog-c));
  box-shadow: 0 0 12px var(--prog-glow);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

body.my-page .mt-prog-dot {
  position: absolute;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  border: 3px solid #cfded5;
  box-shadow: 0 2px 5px rgba(20, 50, 30, 0.18);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

body.my-page .mt-prog-dot.d1 { left: 0; }
body.my-page .mt-prog-dot.d2 { left: 50%; }
body.my-page .mt-prog-dot.d3 { left: 100%; }

body.my-page .mt-prog.st-new .d1,
body.my-page .mt-prog.st-working .d1,
body.my-page .mt-prog.st-working .d2,
body.my-page .mt-prog.st-done .d1,
body.my-page .mt-prog.st-done .d2,
body.my-page .mt-prog.st-done .d3 {
  background: var(--prog-c);
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--prog-glow), 0 0 14px var(--prog-glow);
}

body.my-page .mt-prog.st-working .d2 {
  animation: mtPulse 1.6s ease-in-out infinite;
}

@keyframes mtPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--prog-glow), 0 0 14px var(--prog-glow); }
  50% { box-shadow: 0 0 0 7px rgba(29, 78, 216, 0.18), 0 0 22px var(--prog-glow); }
}

body.my-page .mt-prog-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--tk-muted);
}

body.my-page .mt-prog.st-new .mt-prog-labels span:nth-child(1),
body.my-page .mt-prog.st-working .mt-prog-labels span:nth-child(1),
body.my-page .mt-prog.st-working .mt-prog-labels span:nth-child(2),
body.my-page .mt-prog.st-done .mt-prog-labels span:nth-child(-n+3) {
  color: var(--prog-c);
  font-weight: 700;
}

body.my-page .mt-note {
  margin: 10px 0 0;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.6;
}

body.my-page .mt-note.st-new { background: rgba(255, 214, 120, 0.28); color: #7a4e06; }
body.my-page .mt-note.st-working { background: rgba(169, 194, 255, 0.28); color: #17357f; }
body.my-page .mt-note.st-done { background: rgba(142, 240, 196, 0.30); color: #064a29; }

body.my-page .mt-actions {
  display: flex;
  gap: 10px;
  margin: 14px 0 18px;
}

body.my-page .mt-action {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.18s ease, box-shadow 0.2s ease;
}

body.my-page .mt-action.ghost {
  border: 1.5px solid rgba(13, 90, 55, 0.16);
  background: rgba(255, 255, 255, 0.7);
  color: var(--tk-ink);
}

body.my-page .mt-action.ghost:hover { background: #fff; transform: translateY(-1px); box-shadow: var(--tk-shadow-sm); }

body.my-page .mt-action.pdf {
  border: none;
  background: linear-gradient(135deg, #00c97d, #00965b);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 150, 91, 0.36);
}

body.my-page .mt-action.pdf:hover { transform: translateY(-2px); filter: saturate(1.12); box-shadow: 0 14px 30px rgba(0, 150, 91, 0.46); }

body.my-page .mt-action.urgent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  background: linear-gradient(135deg, #f2575b, #e5484d);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(229, 72, 77, 0.36);
}

body.my-page .mt-action.urgent:hover { transform: translateY(-2px); filter: saturate(1.1); box-shadow: 0 14px 30px rgba(229, 72, 77, 0.45); }
body.my-page .mt-action.urgent:active { transform: translateY(1px) scale(0.98); }

/* ---------- ข้อมูลใบแจ้งซ่อม : ช่องสี่เหลี่ยม 2 คอลัมน์ ---------- */
body.my-page .mt-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 0 4px;
}

body.my-page .mt-pbox {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 62px;
  padding: 9px 11px;
  border: 1px solid var(--tk-glass-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.my-page .mt-pbox-wide { grid-column: 1 / -1; }

body.my-page .mt-lb {
  font-size: 11.5px;
  color: var(--tk-muted);
  line-height: 1.3;
}

body.my-page .mt-vl {
  font-size: 14.5px;
  color: var(--tk-ink);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-line;
}

body.my-page .mt-desc { font-size: 15px; line-height: 1.6; }

body.my-page .mt-mono {
  font-family: Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.3px;
}

body.my-page .mt-pbox .mt-photo-list { margin-top: 2px; }

/* ---------- จอเล็ก: 1 คอลัมน์ ---------- */
@media (max-width: 359px) {
  body.my-page .mt-panel { grid-template-columns: 1fr; }
}

/* ---------- ว่าง ---------- */
body.my-page .mt-empty {
  background: var(--tk-card);
  border: 1.5px dashed rgba(0, 178, 106, 0.35);
  border-radius: 22px;
  padding: 36px 20px;
  text-align: center;
  color: var(--tk-muted);
  font-size: 15px;
  line-height: 1.6;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: mtRise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.my-page .mt-empty svg { color: #a9d9bf; margin-bottom: 12px; animation: mtBob 2.4s ease-in-out infinite; }
@keyframes mtBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

body.my-page .mt-empty-link {
  display: inline-block;
  margin-top: 16px;
  padding: 13px 24px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #00c97d, #00965b);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 150, 91, 0.36);
  transition: transform 0.16s ease, box-shadow 0.22s ease, filter 0.2s ease;
}
body.my-page .mt-empty-link:hover { transform: translateY(-2px); filter: saturate(1.12); box-shadow: 0 14px 30px rgba(0, 150, 91, 0.46); }

/* ---------- Toast : อยู่บน (ไม่มี action bar ด้านล่าง) ---------- */
body.my-page .toast {
  bottom: auto;
  top: calc(16px + env(safe-area-inset-top));
}

/* ---------- จอเล็กจัด ---------- */
@media (max-width: 380px) {
  body.my-page .mt-k { flex-basis: 84px; }
  body.my-page .mt-stamp { padding: 6px 10px; font-size: 13px; }
  body.my-page .mt-no { font-size: 18px; }
  body.my-page .mt-photo { width: 58px; height: 58px; }
  body.my-page .mt-prog-labels { font-size: 11px; }
}