/* AWC Work Request – ส่วนเพิ่มจาก style.css เดิม */

/* ประเภทงาน */
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.type-grid button { font-family: inherit; text-align: left; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--line); background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.type-grid button:hover { border-color: #9FB3CB; }
.type-grid button[aria-pressed="true"] { background: var(--soft-blue); border-color: var(--blue); }
.type-grid b { color: var(--navy); font-size: 16px; }
.type-grid .route { margin-top: 6px; align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--blue); background: #F0F5FB; padding: 2px 10px; border-radius: 100px; }
.type-grid .route.direct { color: #8A5300; background: #FDF1DF; }
.type-grid button[aria-pressed="true"] .route { background: #fff; }

.choice-pills button { display: inline-flex; align-items: center; gap: 6px; }
.group-invalid { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 12px; }

/* พื้นที่จาก QR */
.qr-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: #E3F2EA; border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.qr-note strong { color: var(--navy); font-size: 15px; }
.qr-note .linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-decoration: underline; margin-left: auto; }

/* ไฟล์แนบ */
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-list li { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.file-list img, .file-ico { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; }
.file-ico { background: var(--soft-blue); color: var(--blue); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.fname { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.fname b { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop input { display: none; }
.attach-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.attach-btns .drop { padding: 18px 12px; }
.attach-btns .drop:hover { border-color: var(--blue); background: var(--soft-blue); }

/* กำลังส่งเข้า MAS */
.send-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 520px; text-align: left; }
.send-steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.send-steps li > span:last-child { display: flex; flex-direction: column; }
.send-steps b { font-weight: 600; font-family: inherit; }
.send-steps .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--field); flex: none; margin-top: 2px; position: relative; }
.send-steps li.done { color: var(--ink); }
.send-steps li.done .tick { background: var(--green); border-color: var(--green); }
.send-steps li.done .tick::after { content: ''; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--soft-blue); border-top-color: var(--blue); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ok-info { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 10px; text-align: left; background: #F7F9FC; border-radius: 12px; padding: 18px; }

/* route panel */
.route-kv { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.route-kv div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.15); padding-bottom: 8px; }
.route-kv div:last-child { border-bottom: 0; padding-bottom: 0; }
.route-kv b { color: #fff; text-align: right; }
.route-table { width: 100%; min-width: 0; font-size: 13px; color: #D6E4F5; }
.route-table td { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
.route-table td:last-child { text-align: right; color: #fff; font-weight: 600; }

.prio-badge { background: #F7F9FC; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }

/* หน้าแรก */
.loc-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.loc-link { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; color: var(--navy); }
.loc-link:hover { border-color: var(--blue); }

/* ติดตามสถานะ */
.mine { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mine li { display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.mine li:last-child { border-bottom: 0; }
.mine .badge { align-self: flex-start; }
.track-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.track-bar input { flex: 1 1 220px; width: auto; }
.demo-tool { border: 1.5px dashed var(--orange); background: #FFFBF3; }

@media (max-width: 640px) {
  /* iPhone ไม่ซูมหน้าจอเองตอนแตะช่องกรอก */
  input, select, textarea { font-size: 16px; }
  .demo-bar { font-size: 12px; padding: 4px 12px; }
  .site-header .container { gap: 8px; padding-top: 10px; padding-bottom: 0; }
  .logo { width: 40px; height: 40px; font-size: 13px; }
  .nav { width: 100%; gap: 0; flex-wrap: nowrap; overflow-x: auto; border-top: 1px solid var(--line); margin: 0 -16px; padding: 0 8px; width: calc(100% + 32px); }
  .nav a { flex: 1 0 auto; text-align: center; padding: 10px 10px 8px; border-bottom: 3px solid transparent; white-space: nowrap; }
  .nav a.active { border-bottom-color: var(--blue); }
  .page { padding: 18px 0 40px; }
  .panel { padding: 18px; gap: 18px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi b { font-size: 26px; }
  .search { min-width: 0; width: 100%; }
  .toolbar-right, .toolbar-right select { width: 100%; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .attach-btns .drop { padding: 16px 8px; }
  .hero .container { gap: 28px; }
  /* ตารางงาน -> การ์ดบนมือถือ */
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; min-width: 0; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
  .table-wrap td { border: 0; padding: 3px 0; display: flex; gap: 12px; justify-content: space-between; text-align: right; }
  .table-wrap td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex: none; }
  .table-wrap td > .cell { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 2px; }
  .table-wrap td.empty { justify-content: center; }
  .table-wrap td.empty::before { content: none; }
  .type-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .type-grid button { padding: 12px; }
  .type-grid b { font-size: 15px; }
  .type-grid .small { font-size: 12px; }
}

