/* T-Purchase V2 overlay - scoped, keeps original T-Go Hub structure */
.tpv2{font-family:"Noto Sans Thai","Segoe UI",sans-serif;color:#172033;background:#f5f7fb;min-height:calc(100vh - 64px)}
.tpv2 *{box-sizing:border-box}.tpv2 button,.tpv2 input,.tpv2 select{font:inherit}.tpv2-shell{display:grid;grid-template-columns:240px 1fr;min-height:calc(100vh - 64px)}
.tpv2-rail{background:#111827;color:white;padding:18px 14px;display:flex;flex-direction:column;gap:16px}.tpv2-brand{display:flex;gap:12px;align-items:center;padding:8px}.tpv2-brand-logo{width:38px;height:38px;border-radius:12px;background:#6d5bd0;display:grid;place-items:center;font-weight:800}.tpv2-brand b{display:block}.tpv2-brand span{font-size:12px;color:#cbd5e1}.tpv2-nav{display:flex;flex-direction:column;gap:6px}.tpv2-nav button{border:0;background:transparent;color:#d1d5db;text-align:left;padding:11px 12px;border-radius:12px;cursor:pointer}.tpv2-nav button.active,.tpv2-nav button:hover{background:#6d5bd0;color:white}.tpv2-help{margin-top:auto;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);border-radius:16px;padding:14px;font-size:12px;color:#cbd5e1}
.tpv2-main{padding:22px;min-width:0}.tpv2-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.tpv2-title{font-size:24px;font-weight:800;margin:0}.tpv2-sub{margin:4px 0 0;color:#64748b;font-size:13px}.tpv2-actions{display:flex;gap:8px;flex-wrap:wrap}.tpv2-btn{border:1px solid #dbe2ef;background:white;border-radius:10px;padding:9px 13px;cursor:pointer;color:#334155;font-weight:700}.tpv2-btn.primary{background:#6d5bd0;color:white;border-color:#6d5bd0}.tpv2-btn.success{background:#16a34a;color:white;border-color:#16a34a}.tpv2-btn.danger{color:#dc2626}.tpv2-btn.sm{padding:6px 9px;font-size:12px}.tpv2-card{background:white;border:1px solid #e5e7eb;border-radius:18px;box-shadow:0 1px 2px rgba(15,23,42,.04);overflow:hidden}.tpv2-card-pad{padding:18px}.tpv2-grid{display:grid;gap:16px}.tpv2-grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}.tpv2-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}.tpv2-layout{grid-template-columns:minmax(0,1fr) 330px}.tpv2-kpi .num{font-size:30px;font-weight:800;margin-top:8px}.tpv2-muted{color:#64748b}.tpv2-filter{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:10px;margin-bottom:16px}.tpv2 input,.tpv2 select,.tpv2 textarea{border:1px solid #dbe2ef;border-radius:10px;padding:9px 11px;background:white;min-width:0}.tpv2-table-wrap{overflow:auto}.tpv2 table{width:100%;border-collapse:collapse;font-size:13px}.tpv2 th{background:#f8fafc;color:#475569;text-align:left}.tpv2 th,.tpv2 td{border-bottom:1px solid #e5e7eb;padding:11px;vertical-align:middle}.tpv2 tr:hover td{background:#fbfdff}.tpv2 .right{text-align:right}.tpv2-badge{display:inline-flex;border:1px solid;border-radius:999px;padding:4px 9px;font-size:12px;font-weight:800;white-space:nowrap}.tpv2-badge.draft,.tpv2-badge.pending{background:#fffbeb;color:#b45309;border-color:#fde68a}.tpv2-badge.approved,.tpv2-badge.enough{background:#ecfdf5;color:#047857;border-color:#bbf7d0}.tpv2-badge.need{background:#fff7ed;color:#c2410c;border-color:#fed7aa}.tpv2-badge.rejected{background:#fef2f2;color:#b91c1c;border-color:#fecaca}.tpv2-form-head{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 28px}.tpv2-field{display:grid;grid-template-columns:150px 1fr;gap:10px;align-items:center}.tpv2-field label{color:#64748b;font-size:13px}.tpv2-summary-line{display:flex;justify-content:space-between;margin:11px 0}.tpv2-total{border-top:1px solid #e5e7eb;padding-top:14px;margin-top:12px;display:flex;justify-content:space-between;font-size:20px;font-weight:900;color:#6d5bd0}.tpv2-section-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #e5e7eb}.tpv2-link{border:0;background:transparent;color:#5b21b6;font-weight:800;cursor:pointer;padding:0}.tpv2-pdf-page{background:white;max-width:900px;min-height:1180px;margin:0 auto;padding:40px;box-shadow:0 18px 50px rgba(15,23,42,.25)}.tpv2-pdf-wrap{background:#cbd5e1;padding:24px}.tpv2-pdf-title{font-size:48px;font-weight:900;color:#8b5cf6}.tpv2-pdf-box{background:#ede9fe;border-radius:12px;padding:14px;line-height:1.9}.tpv2-sign-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;text-align:center;font-size:12px}.tpv2-sign{height:88px;border:1px dashed #cbd5e1;margin:10px 0;display:grid;place-items:center;color:#94a3b8}
@media(max-width:1100px){.tpv2-shell{grid-template-columns:1fr}.tpv2-rail{position:relative}.tpv2-layout,.tpv2-grid-4,.tpv2-grid-3,.tpv2-filter{grid-template-columns:1fr}.tpv2-form-head{grid-template-columns:1fr}}
@media print{body *{visibility:hidden}.tpv2-pdf-page,.tpv2-pdf-page *{visibility:visible}.tpv2-pdf-page{position:absolute;left:0;top:0;box-shadow:none;width:100%;max-width:none}.tpv2-top,.tpv2-rail{display:none!important}}

/* v18.1 production additions */
.tpv2-prod-banner{margin-bottom:16px;padding:14px 16px;border:1px solid #c4b5fd;background:#f5f3ff;border-radius:16px;display:flex;gap:12px;align-items:center;justify-content:space-between;color:#4c1d95}
.tpv2-prod-banner b{font-size:15px}.tpv2-prod-banner span{font-size:13px;color:#6d28d9}
.tpv2-checklist{margin:0;padding-left:20px;line-height:1.9}.tpv2-checklist code{background:#f1f5f9;border:1px solid #e2e8f0;padding:2px 6px;border-radius:6px}
.tpv2 textarea{resize:vertical}

/* V1.22 T-Purchase lead-time tracking polish */
.tpv2-risk{font-weight:800;white-space:nowrap}
.tpv2-table-wrap th,.tpv2-table-wrap td{vertical-align:middle}
.tpv2-filter select,.tpv2-filter input{min-height:38px}
.tpv2-field input[type="date"]{font-weight:700;color:#111827}
.tpv2-section-head .tpv2-muted{font-weight:500}
.tpv2-report-item{border:1px solid #e5e7eb;border-radius:16px;padding:14px;background:#fff}
.tpv2-report-num{font-size:22px;font-weight:900;color:#111827;margin-top:4px}
