/* =====================================================
   EABaseHub — formActual.css
   Theme: Clean Professional Teal (เดียวกับ formPlan)
   ใช้ formPlan.css เป็น base แล้ว override เฉพาะจุด
   ===================================================== */

   @import url('formPlan.css');
   
   /* =====================================================
   OVERRIDES & EXTRAS สำหรับ formActual
   ===================================================== */
   :root{
     --primary:#0d9488;
     --primary-dark:#0f766e;
     --primary-xdark:#115e59;
     
     --bg-base:#f0fdfa;
     --bg-card:#ffffff;
     
     --border:#99f6e4;
     --radius-md:12px;
    }
    
.paper {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-xdark) 100%);
  box-shadow: var(--shadow-xs);
  
} 
    
/* หัวการ์ด */
.paper h2 {
  font-size: 20px;
  font-weight: 700; 
  color: var(--bg-card);
  text-align: center;  
  margin-bottom: 6px;
}

/* ตัวเลขในตาราง: align right + tabular */
#tableBody td input[type="number"] {
  text-align: right;
  padding-right: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

/* เส้นทาง และ หมายเหตุ: align left */
#tableBody td:nth-child(2) input,
#tableBody td:last-child input {
  text-align: left;
  padding-left: 10px;
}

/* Summary box โดดเด่นขึ้น */
.summary-box {
  background: linear-gradient(135deg, var(--teal-50) 0%, #eff6ff 100%);
  border: 1.5px solid var(--teal-200);
  padding: 16px 28px;
  border-radius: var(--r-md);
  margin-top: 18px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--teal-700);
  box-shadow: var(--shadow-xs);
}

.summary-box strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--teal-600);
  margin: 0 4px;
}

/* =====================================================
   EXTRAS สำหรับ formActual
   ===================================================== */

/* ── Plan Banner ── */
.plan-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1.5px solid #86efac;
  border-radius: var(--r-md);
  padding: 12px 18px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  color: #166534;
  flex-wrap: wrap;
  animation: slideUp 0.3s ease;
}

.plan-banner .material-symbols-outlined {
  font-size: 20px;
  color: #16a34a;
  flex-shrink: 0;
}

.plan-banner span:nth-child(2) { flex: 1; min-width: 160px; }

/* ปุ่ม นำข้อมูลมาใช้ */
.btn-import {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn-import:hover { background: #15803d; transform: translateY(-1px); }
.btn-import .material-symbols-outlined { font-size: 15px; }

/* ปุ่มปิด banner */
.btn-banner-dismiss {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font);
  transition: all 0.15s;
}
.btn-banner-dismiss:hover { background: rgba(0,0,0,0.06); color: #1a1a1a; }

/* ── Import hint ── */
.import-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--r-sm);
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: #92400e;
}
.import-hint .material-symbols-outlined { font-size: 17px; color: #d97706; }

/* ── ปุ่มโหลดแผน ── */
.btn-load-plan {
  width: 100%;
  padding: 10px 14px;
  background: var(--teal-500);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-load-plan:hover { background: var(--teal-600); transform: translateY(-1px); }

/* ── ปุ่ม Preview ── */
.btn-preview {
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 2px 8px rgba(124,58,237,0.25);
}
.btn-preview:hover {
  background: #6d28d9;
  box-shadow: 0 4px 14px rgba(124,58,237,0.35);
  transform: translateY(-1px);
}

/* ── Preview Modal (เหมือน formPlan) ── */
.preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,20,30,0.70);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: flex-start;
  z-index: 2000;
  padding: 20px 16px 30px;
  overflow-y: auto;
}

.preview-wrapper {
  background: #dde3ea;
  padding: 18px 18px 28px;
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 820px;
  margin: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}

.preview-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 14px;
  background: #1a6b64;
  border-radius: var(--r-md);
}

.preview-actions button {
  padding: 7px 16px;
  font-size: 13px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  transition: all 0.18s ease;
}
.preview-actions button:hover {
  background: rgba(255,255,255,0.28);
  transform: translateY(-1px);
}
.preview-actions button:last-child {
  background: rgba(239,68,68,0.25);
  border-color: rgba(239,68,68,0.4);
  margin-left: auto;
}
.preview-actions button:last-child:hover { background: rgba(239,68,68,0.45); }

/* A4 page */
.a4-page {
  width: 100%;
  max-width: 760px;
  min-height: 1040px;
  padding: 32px 40px 40px;
  margin: 0 auto;
  background: #fff;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.65;
  box-shadow: 0 4px 32px rgba(0,0,0,0.22);
  border-radius: 2px;
  border-top: 4px solid #3FB7AE;
}


.draft-item {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
}

.draft-item:hover {
  background: #f0f9f8;
}

.draft-btn {
  background: #3FB7AE;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}


/* Print */
/* =====================================================
   17. PRINT
   ===================================================== */
@media print {
  * { visibility: hidden !important; }

  #previewContent,
  #previewContent * { visibility: visible !important; }

  #previewContent {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 10mm !important;
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }
}