 
  :root {
    --sw:260px; 
    --th:56px;
    --navy:#0F2D54; 

    --blue:#0F4C81; 
    --blue-l:#E8F1FB;

    --green:#00875A; 
    --green-l:#E3F5EF; 
    --green-d:#005C3D;

    --amber:#B45309; 
    --amber-l:#FEF3C7;

    --red:#B91C1C; 
    --red-l:#FEE2E2;

    --purple:#764cba; 
    --purple-l:#EDE9FE;

    --cyan: #0f758c;     
    --cyan-l: #ddfcff;
 
    
    --rose: #F43F5E;
    --rose-l: #FFF1F2;

    --orange: #ea580c;
    --orange-l: #fff7ed;
    
    --indigo: #6366F1;     
    --indigo-l: #EEF2FF;

    --border:#E2E8F0; 
    --surface:#F7F9FC; 
    --text:#1A1F2E; 
    --muted:#64748B; 
    --card:#fff;
    --mono:'IBM Plex Mono',monospace;

    /* บังคับ Bootstrap component ทุกตัว (btn, form-control, dropdown ฯลฯ) ให้ใช้ font เดียวกับทั้งระบบ
       เพราะ Bootstrap เองอ้างอิง var นี้ตรงๆ ไม่ได้สืบทอด font-family จาก body */
    --bs-body-font-family:'Sarabun',sans-serif;
  }
  
  *{box-sizing:border-box;margin:0;padding:0;}
  body{font-family:'Sarabun',sans-serif;background:var(--surface);color:var(--text);font-size:16px;overflow-x:hidden;}

  /* ── SIDEBAR ── */
  .sidebar{
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    width:var(--sw);
    background:var(--navy);
    display:flex;
    flex-direction:column;
    z-index:200;
    transition:transform .25s;
  }
  .sb-head{
    padding:18px 18px 14px;
    border-bottom:1px solid rgba(255,255,255,.08);
  }
  .sb-logo{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:10px;
  }
  .sb-logo-ic{
    width:45px;
    height:45px;
    border-radius:10px;
    background:linear-gradient(135deg,#1A6BB5,#00A86B);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:40px;
  }
  .sb-logo h1{
    margin-top: 10px;
    color:#fff;
    font-size:20px;
    font-weight:800;
    line-height:1;
  }
  .sb-logo p{
    color:rgba(255,255,255,.30);
    font-size:14px;
  }
  .sb-user{
    background:rgba(255,255,255,.07);
    border-radius:9px;
    padding:9px 11px;
    display:flex;
    align-items:center;
    gap:9px;
  }

  .sb-avatar{
    width:30px;
    height:30px;
    border-radius:50%;
    background:linear-gradient(135deg,#3B82F6,#8B5CF6);
    display:flex;
    align-items:center;justify-content:center;color:#fff;
    font-size:14px;
    font-weight:700;
  }
  .sb-uname{
    color:#fff;
    font-size:14px;
    font-weight:600;    
  }
  .sb-urole{
    color:rgba(255,255,255,.40);
    font-size:14px;
  }

  .sb-nav{
    flex:1;
    overflow-y:auto;
    padding:12px 10px
  } 
  .sb-nav a {
      text-decoration: none !important; /* ลบขีดเส้นใต้ */ 
      display: flex;                   /* ช่วยให้ไอคอนและตัวหนังสือเรียงกันสวยงาม */
      align-items: center;             /* จัดกึ่งกลางแนวตั้ง */
      width: 100%;                     /* ให้พื้นที่คลิกเต็มความกว้าง */
  }
  
  .sb-nav a:hover, 
  .sb-nav a:focus, 
  .sb-nav a:active {
      text-decoration: none; 
  }
  .sb-group{
    color:rgba(255,255,255,.28);
    font-size:14px;
    font-weight:700;
    letter-spacing:1.2px;
    text-transform:uppercase;
    padding:8px 8px 4px;
    
  }
  .nav-item{
    display:flex;align-items:center;
    gap:10px;
    padding:9px 11px;
    border-radius:9px;
    cursor:pointer;
    color:rgba(255,255,255,.5);
    font-size:14px;
    font-weight:500;
    transition:all .15s;margin-bottom:2px;
    position:relative;
  } 
  .nav-item:hover {
    background: rgba(255,255,255,.08);   
    color: rgba(255,255,255,.9);
  }
  .nav-item.active{
    background:rgba(255,255,255,.13);
    color:#fff;
    font-weight:700
  }
  .nav-item .ni{
    width:30px;
    height:30px;
    border-radius:8px;
    background:rgba(255,255,255,.08);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
    flex-shrink:0;
    transition:all .15s;
  }
  .nav-item.active .ni{
    background:var(--blue);
  }
  .nav-badge{
    margin-left:auto;
    font-size:14px;
    font-weight:700;
    padding:2px 7px;
    border-radius:10px
  }
  .nb-red{
    background:#EF4444;
    color:#fff;
  }
  .nb-gray{
    background:rgba(255,255,255,.15);
    color:rgba(255,255,255,.65);
  }
  .nb-green{
    background:#059669;
    color:#fff;
  }
  .sb-foot{
    padding:12px 10px;
    border-top:1px solid rgba(255,255,255,.08);
  }

/* submenu container */
.nav-sub {
  padding: 2px 0 4px 12px;
  margin-bottom: 2px;
}

/* submenu item — ขนาดเล็กกว่า nav-item นิดหน่อย */
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: rgba(255,255,255,.5);
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
  margin-bottom: 1px;
}
.nav-sub-item:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
}
.nav-sub-item.active {
  background: rgba(255,255,255,.13);
  color: #fff;
  font-weight: 700;
}

/* dot แทน icon */
.sub-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  flex-shrink: 0;
  transition: all .15s;
}
.sub-dot.active,
.nav-sub-item.active .sub-dot {
  background: #fff;
}

/* ลูกศร expand/collapse */
.sub-arrow {
  color: rgba(255,255,255,.3);
  font-size: 14px;
  pointer-events: none; /* ให้ parent div จัดการ click */
}

/*swal2 */
.swal2-popup{
  font-family:'Sarabun',sans-serif;
}
.swal2-title{
  padding-top: 5px;
}

  /* ── TOPBAR ── */
  .topbar{
    position:fixed;
    top:0;left:var(--sw);
    right:0;
    height:var(--th);
    background:#fff;
    border-bottom:1px solid var(--border);
    display:flex;
    align-items:center;padding:0 22px;
    gap:14px;
    z-index:100;
    box-shadow:0 1px 4px rgba(0,0,0,.05);
  }
  .tb-title{
    font-size:16px;
    font-weight:500;
    padding: 10px auto;
    color: var(--text);
  } 
  .tb-btn{
    width:34px;
    height:34px;
    border-radius:8px;
    background:var(--surface);
    border:1px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    color:var(--muted);
    font-size:14px;
    transition:all .15s;
  }
  .tb-btn:hover{
    background:var(--blue-l);
    color:var(--blue);
    border-color:var(--blue);
  }
  .tb-btn-user{background:#eef4fc;border-color:#b8d4f0;color:#1a3a5c;}
  .tb-btn-user:hover{background:#ddeaf8;border-color:#90bce8;color:#1a3a5c;}
  .tb-user-info{
    font-size:14px;
    font-weight:500;
    color:#1a3a5c;
    padding:0 12px;
    height:34px;
    display:flex;
    align-items:center;
    border:1px solid #b8d4f0;
    border-radius:8px;
    background:#eef4fc;
    white-space:nowrap;
    cursor:default;
  }
  button.tb-user-info:hover{background:#ddeaf8;border-color:#90bce8;}

  #tb-auth-menu{
    border:1px solid var(--border);
    border-radius:10px;
    box-shadow:0 8px 24px rgba(15,45,84,.14);
    padding:6px;
    margin-top:6px;
    min-width:220px;
    right:0;
    left:auto;
  }
  #tb-auth-menu .dropdown-item{
    border-radius:7px;
    font-size:14px;
    font-weight:500;
    color:var(--navy);
    padding:8px 12px;
    white-space:nowrap;
  }
  #tb-auth-menu .dropdown-item i{color:var(--blue);}
  #tb-auth-menu .dropdown-item:hover,
  #tb-auth-menu .dropdown-item:focus{
    background:var(--blue-l);
    color:var(--blue);
  }
  #tb-auth-menu .dropdown-item.active{
    background:var(--blue-l);
    color:var(--navy);
    font-weight:700;
  }
  #tb-auth-menu .dropdown-item.active i{color:var(--navy);}
  #tb-auth-menu .dropdown-divider{
    margin:4px 0;
    border-color:var(--border);
  }
  .hamburger{
    display:none;
  }

  /* ── CONTENT ── */
  .content{
    margin-left:var(--sw);
    padding-top:var(--th);
  }
  .page{
    display:none;
    padding:24px 26px 80px;
    animation:fadeUp .2s ease;
  }

  .page.active{
    display:block;
  }
  @keyframes fadeUp{
    from{
      opacity:0;
      transform:translateY(8px);
    }to{
      opacity:1;
      transform:translateY(0);
    }
  }

  .form-check {
    font-size: 14px;
    color: var(--text);
  }

  /* ── 2-TAB STEPPER ── */
  .form-stepper{
    background:#fff;
    border:1px solid var(--border);
    border-radius:14px;
    overflow:clip;margin-bottom:20px;
  }  
  .stepper-header{
    display:flex;
    border-bottom:3px solid var(--border);
    --step-active-bg: var(--blue-l); /* ค่าเริ่มต้น */
    --step-active-color: var(--blue); /* ค่าเริ่มต้น */
    
  }
  .stepper-header.st-gift {
    --step-active-bg: var(--amber-l);
    --step-active-color: var(--amber);
  }
  .stepper-header.st-entertain {
    --step-active-bg: var(--amber-l);   
    --step-active-color: var(--amber);  
  }
  .stepper-header.st-donation {
    --step-active-bg: var(--purple-l);   
    --step-active-color: var(--purple);  
  }
  .stepper-header.st-conflict {
    --step-active-bg: var(--cyan-l);   
    --step-active-color: var(--cyan);  
  }

  .stepper-tab{
    flex:1;display:flex;
    align-items:center;
    gap:12px;padding:16px 20px;
    cursor:pointer;
    transition:all .15s;
    border-bottom:3px solid transparent;
    margin-bottom:-2px;
    position:relative;
    color: var(--muted); 
  }
  .stepper-tab:hover{
    background:var(--surface);
  }
  .stepper-tab.active {
    /* background: var(--step-active-bg) !important; */
    border-bottom-color: var(--step-active-color) !important;
  }
  .stepper-tab.active .st-label {
    color: var(--step-active-color);
  }
  .stepper-tab.done{
    background:var(--green-l);
    border-bottom-color:var(--green);
  }
  
  .stepper-tab.locked {
    /* opacity: 0.45; */
    cursor: not-allowed;
    pointer-events: auto;        /* ← hover ได้ เห็น cursor */
}

.stepper-tab.locked * {
    pointer-events: none;        /* ← กัน click ที่ลูก */
}

  .st-num{width:38px;
    height:38px;
    border-radius:50%;
    border:2px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:16px;
    font-weight:800;
    flex-shrink:0;
    transition:all .15s;
    color:var(--muted);
    background:#fff;
  }
  .stepper-tab:first-child.active .st-num{
    background:var(--blue);
    border-color:var(--blue);
    color:#fff;
  }
  .stepper-tab:nth-child(2).active .st-num{
    background:var(--green);
    border-color:var(--green);
    color:#fff;
  }
  .stepper-tab.done .st-num{
    background:var(--green);
    border-color:var(--green);
    color:#fff;
  }
  .stepper-tab.locked .st-num{
    background:#F1F5F9;
  }
  .st-label{
    font-size:16px;
    font-weight:700;
    line-height:1.3;
  }
  .st-sub{
    font-size:14px;
    color:var(--muted);
    margin-top:2px;
  }
  .stepper-tab.active .st-sub{
    color:var(--blue);
  }
  .stepper-tab.done .st-sub{
    color:var(--green);
  } 
  .st-badge{
    margin-left:auto;
    padding:3px 10px;
    border-radius:12px;
    font-size:14px;
    font-weight:700;
    flex-shrink:0;
  }
  .stb-pending{
    background:var(--amber-l);
    color:var(--amber);
  }
  .stb-approved{
    background:var(--green-l);
    color:var(--green);
  }
  .stb-done{
    background:#E0E7FF;
    color:#3730A3;
  }
  .stb-locked{
    background:var(--surface);
    color:var(--muted);
  }

  .stepper-body{
    padding:0px;
  }
  .step-panel{
    display:none;
  }
  .step-panel.active{
    display:block;
    animation:fadeUp .2s ease;
  }

  /* ── SECTION HEADER ── */
  .sec-hdr{
    display:flex;
    align-items:center;
    gap:9px;
    padding:9px 14px;
    border-radius:9px;
    margin-bottom:8px;
    font-size:14px;
    font-weight:700
  }
  .sec-hdr.navy{
    background:var(--blue-l);
    color:var(--navy);
    border-left:3px solid var(--navy);
  }
  .sec-hdr.blue{
    background:var(--blue-l);
    color:var(--blue);
    border-left:3px solid var(--blue);
  }
  .sec-hdr.green{
    background:var(--green-l);
    color:var(--green);
    border-left:3px solid var(--green);
  }
  .sec-hdr.amber{
    background:var(--amber-l);
    color:var(--amber);
    border-left:3px solid #F59E0B;
  }
  .sec-hdr.red{background:var(--red-l);
    color:var(--red);
    border-left:3px solid var(--red);
  }
  .sec-hdr.purple{
    background:var(--purple-l);
    color:var(--purple);
    border-left:3px solid var(--purple)
  }
  .sec-hint{
    font-size:14px;
    font-weight:400;
    opacity:.6;
    margin-left:0;
    display:none;
  }
  .sec-hdr.cyan{    
    background:var(--cyan-l);
    color:var(--cyan);
    border-left:3px solid var(--cyan)
  }

  /* ── FORM ── */
  .form-card{
    background:var(--card);
    /* border:1px solid var(--border); */
    border-radius:12px;
    padding:18px;
    margin-bottom:16px;
    /* box-shadow:0 1px 3px rgba(0,0,0,.04); */
  }
  .form-label{
    font-size:14px;
    font-weight:600;
    color:var(--text);
    margin-bottom:5px;
  }
  .form-label .req{
    color:var(--red);
  }
  .form-control::placeholder {
    color: #AAAAAA;
    opacity: 1;
  }
  .form-control,.form-select{
    border:1.5px solid var(--border);
    border-radius:8px;
    font-family:'Sarabun',sans-serif;
    font-size:14px;
    padding:8px 12px;
    transition:all .15s;
    margin-bottom: 5px;
  }
  .form-control:focus,.form-select:focus{
    border-color:var(--blue);
    box-shadow:0 0 0 3px rgba(15,76,129,.1);
    outline:none;
  }
  .form-control.is-invalid{
    border-color:var(--red);
    /* background:var(--red-l); */
  }
  .form-control:disabled,
  .form-select:disabled {
      cursor: not-allowed;
      background-color: var(--surface);
      
      opacity: 1;
  }

  .form-control:disabled:hover,
  .form-select:disabled:hover {
      /* border-color: var(--red); */
      cursor: not-allowed;
  }
  .invalid-feedback{
    font-size:14px;
    color:var(--red);
    margin-top:3px;
  }

  /* ── GIFT TABLE ── */
  .gift-table-wrap{
    overflow-x:auto;
    border-radius:10px;
    border:1px solid var(--border);
  }
  .gift-table{
    width:100%;
    border-collapse:collapse;
    min-width:650px;
  }

  #home-table thead th{
    background:var(--blue-l);
    color:var(--navy);
  }
  #home-table tbody td{padding:12px 9px;}
  #home-table thead th:first-child{border-radius:10px 0 0 0;}
  #home-table thead th:last-child{border-radius:0 10px 0 0;}
  .gift-table thead th{
    background:var(--surface);
    color:var(--text);
    padding:9px 9px;
    font-size:14px;
    font-weight:700;
    text-align:center;
    white-space:nowrap;
  }
  
  .gift-table tbody tr{
    border-bottom:1px solid var(--border);
    transition:background .1s;
  }
  .gift-table-blue tbody tr:hover{  background:var(--blue-l); }
  .gift-table-green tbody tr:hover{  background:var(--green-l);  }
  .gift-table-amber tbody tr:hover { background: var(--amber-l); }
  .gift-table-cyan tbody tr:hover { background: #e1eced; }
  .gift-table tbody td{
    padding:5px 5px;
    vertical-align:top;
    /* font-size: 14px; */
  }
  .gift-table tbody td .form-control,
  .gift-table tbody td .form-select{
    padding:5px 7px;
    font-size:14px;
    border-color:#E5E9EF;
    border-radius:6px;
  }
  .gift-table tbody td img{
    margin-bottom: 5px;
    border-radius: 5%;
    border-color: var(--border);
  }

  .gift-table tfoot td{
    padding:9px 10px;
    background:var(--surface);
  }
  .sub-cell{
    /* font-family:var(--mono); */
    /* font-size:14px; */
    font-weight:800;
    color:var(--blue);
    text-align:right;
    padding-right:9px!important;
  }
  .row-num{
    width:28px;
    text-align:center;
    /* font-family:var(--mono); */
    /*font-size:18px;*/
    color:var(--muted);
  }

  /* total bar */
  .total-bar{
    border-radius:10px;
    padding:13px 18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-top:10px;
  }
  .total-bar.blue{
    border: 2px solid var(--blue);
    /*background:linear-gradient(135deg,var(--blue),#1A6BB5);*/
  }
  .total-bar.green{
    border: 2px solid var(--green);
    /*background:linear-gradient(135deg,var(--green),#009E6A);*/
  }
  .total-bar.amber{
    border: 2px solid var(--amber);
    /*background:linear-gradient(135deg,#D97706,#B45309);*/
  }
  .total-bar.purple{
    border: 2px solid var(--purple);
    /*background:linear-gradient(135deg,var(--purple),#7C3AED);*/
  }
  .total-bar .tl{
    /*color:rgba(255,255,255,.75);*/
    color: var(--muted); 
    font-weight:600;
  }
  .total-bar .tv{
    /* font-family:var(--mono); */
    font-size:16px;
    font-weight:800; 
    color: var(--blue);
  }

  /* variance */
  .variance-bar{ 
    border-radius:8px;
    padding:10px 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-top:8px;
  }
  .variance-bar .vl{
    color:var(--green);
    font-size:14px;
    font-weight:700;
  }
  .variance-bar .vv{
    /* font-family:var(--mono); */
    font-size:14px;
    font-weight:700;
  }

/* CAC Check */
.cac-item {
  display: flex;
  align-items: flex-start;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
  /* background-color: var(--surface); */
}
 

/* ── Checked: ไม่เทพื้นหลัง ── */
.cac-item:has(.form-check-input:checked) {
  border-color: var(--border);
  /* background:  var(--surface); */
}

/* ── Text สีเขียวเมื่อ checked ── */
.cac-item:has(.form-check-input:checked) .form-check-label {
  color: var(--green-d);
}

/* ── Toggle สีเขียวเมื่อ checked ── */
.cac-item .form-check-input:checked {
  background-color: var(--green);
  border-color: var(--green);
}
.cac-item .form-check-input:disabled{
  opacity: 1;
}
.cac-item.form-check-input:disabled~.form-check-label, .form-check-input[disabled]~.form-check-label{
  opacity: 1;
}
.cac-item .form-check-input[role="switch"] {
  height: 1.25em;
  margin-top: 3px;
  cursor: pointer;
  flex-shrink: 0;
}

.cac-item .form-check-label {
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  /* color: var(--muted); */
  /* transition: color .15s; */
}

.cac-item .form-check.form-switch {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  width: 100%;
}

.cac-item:has(.form-check-input:disabled) {
  cursor: not-allowed;
  opacity: 1;
}


.cac-item:has(.form-check-input:disabled) .form-check-input,
.cac-item:has(.form-check-input:disabled) .form-check-label {
  cursor: not-allowed;
  pointer-events: none;
}

.cac-auto-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}


/* Upload Photo */
.drop-zone { 
  border: 2px solid color-mix(in srgb, var(--blue), transparent 80%);
  border-radius: 14px;
  padding: 5px;
  text-align: center;
  background: var(--blue-l);
  cursor: pointer;
  transition: all 0.2s ease;
}
 
.drop-zone.highlight {
  border-color: var(--blue);
  background: var(--indigo-l);
}

.drop-zone-prompt i {
  color: var(--blue);
}

.drop-zone-prompt p {
  /* margin-top: 10px; */
  color: var(--muted);
  font-weight: 500;
}


.upload-zone {
  position: relative; /* *** เพิ่มบรรทัดนี้ เพื่อให้ปุ่มอิงตำแหน่งในกรอบ *** */
  border: 2px solid color-mix(in srgb, var(--blue), transparent 80%);
  border-radius: 10px;
  /* padding: 5px; */
  text-align: center;
  background: var(--blue-l);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 150px; /* กำหนดขนาดขั้นต่ำให้ดูสวยงาม */
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
} 

.upload-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 14px;
  color: #888;
}
 
.btn-clear {
  position: absolute;
  /* จัดให้อยู่กึ่งกลางเป๊ะ */
  top: 48%;
  left: 50%;
  display: none; 
  opacity: 0;  
  background: none; 
  border: none;
  color: #d50000;   
  font-size: 32px; 
  z-index: 100;
  cursor: pointer;
  transform: translate(-50%, -50%) scale(0.8);  
  transition: all 0.2s ease-in-out; 
  text-shadow: 0px 0px 8px rgba(255, 255, 255, 0.8), 0px 0px 2px rgba(0, 0, 0, 0.2);
}
 
.upload-zone:hover .btn-clear {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.5);
}
.btn-view-slip {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(15,76,129,0.85);
  border: none; border-radius: 50%;
  width: 30px; height: 30px;
  display: none;
  align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
  cursor: pointer; z-index: 10;
  transition: background .15s;
}
.btn-view-slip:hover { background: var(--blue); }

.upload-zone.fp-slip-locked {
  cursor: default;
  pointer-events: none;
}
.upload-zone.fp-slip-locked .btn-clear,
.upload-zone.fp-slip-locked .btn-view-slip {
  pointer-events: all;
  cursor: pointer;
}

.existing-image-wrap {
  border: 2px solid color-mix(in srgb, var(--blue), transparent 70%);
  border-radius: 10px;
}
.existing-image-wrap .btn-clear {
  display: block !important;
}
.existing-image-wrap:hover .btn-clear {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.2);
}
.receipt-upload-zone {
  min-width: unset;
  min-height: 40px;
  width: 100%;
}
.pdf-upload-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  /* border: 1.5px dashed color-mix(in srgb, var(--blue), transparent 50%); */
  border-radius: 6px;
  padding: 0 10px;
  height: 32px;
  /* background: var(--blue-l); */
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
  overflow: hidden;
  font-size: 14px;
  color: var(--blue);
}
.pdf-upload-row:hover {
  border-color: var(--blue);
}
.pdf-upload-row.drag-over {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue), transparent 85%);
}
.pdf-upload-row.is-invalid {
  border: 1.5px solid var(--red);
  background: var(--red-l);
  color: var(--red);
}
.pdf-upload-icon {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--blue);
}
.pdf-upload-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.pdf-upload-label .text-truncate {
  max-width: 180px;
}
.pdf-clear-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
}
.pdf-clear-btn:hover {
  color: var(--red);
}
.receipt-existing-wrap {
  position: relative;
  min-height: 40px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.receipt-existing-wrap .btn-clear {
  display: block !important;
}
.receipt-existing-wrap:hover .btn-clear {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.2);
}
  
.checkbox-group {
  margin-top: 8px;
}
 
.checkbox-group .form-check {
  display: flex;
  align-items: flex-start;
  padding: 12px 10px 12px 35px;
  border: 1px solid #dee2e6; /* ขอบปกติสีเทา */
  border-radius: 8px;
  background-color: #ffffff;
  transition: all 0.2s ease;
  cursor: pointer;
  /* margin: 0; */
}
 
.checkbox-group .form-check:hover {
  border-color: #198754; /* สีเขียว */
  background-color: rgba(25, 135, 84, 0.05);
}
 
.checkbox-group .form-check:has(.form-check-input:checked) {
  border-color: #198754;
  border-width: 1px;
  background-color: rgba(25, 135, 84, 0.1);
}
 
.checkbox-group .form-check-input:checked {
  background-color: #198754;
  border-color: #198754;
}
 
.checkbox-group .form-check-input {
  margin-right: 10px;
  cursor: pointer;
}

.checkbox-group .form-check-label {
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #2c3e50;
  line-height: 1.4;
}


/* Submit */
.submit-panel{
  background:#fff;
  /*border:1px solid var(--border);*/
  border-radius:12px;
  padding:18px 22px;
  display:flex;
  align-items:center;
  gap:18px;
  flex-wrap:wrap;
  margin-top:8px;
}
.submit-note{
  flex:1;
  font-size:14px;
  color:var(--muted);
  line-height:1.7;
}
.submit-note strong{
  color:var(--text);
}
.btn-sub{
  padding:10px 26px;
  border-radius:9px;
  border:none;
  font-family:'Sarabun',sans-serif;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:7px;
  white-space:nowrap;
  transition:all .15s;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}
.btn-sub:hover{
  transform:translateY(-1px);
  box-shadow:0 4px 16px rgba(0,0,0,.18);
}
/* ── Disabled state ── */
.btn-sub:disabled,
.btn-sub[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}
 
.btn-sub:disabled:hover,
.btn-sub[disabled]:hover {
    cursor: not-allowed;
    opacity: 0.6; 
}
.btn-sub.blue{
  background:var(--blue);
  color:#fff;
  border: 1px solid var(--blue);
}
.btn-sub.green{
  background:var(--green);
  color:#fff;
} 
.btn-sub.amber{
  background:var(--amber);
  color:#fff;
}
.btn-sub.red{
  background:var(--red);
  color:#fff;
}
.btn-sub.purple{
  background:var(--purple);
  color:#fff;
}
.btn-sub.purple-l{
  background:var(--surface);
  color:var(--purple);
  border: 1px solid var(--purple);
}

.btn-sub.cyan{
  background:var(--cyan);
  color:#fff;
}
.btn-sub.blue-l{
  background:var(--surface);
  color:#0F2D54;
  border: 1px solid var(--blue);
}
.btn-sub.green-l{
  background:var(--surface);
  color: var(--green);
  border: 1px solid var(--green);
}
.btn-sub.amber-l{
  background:var(--surface);
  color:var(--amber);
  border: 1px solid var(--amber);
}
.btn-add-row{
  background:none; 
  border:1px solid var(--border);
  color:var(--muted);
  border-radius:7px;
  padding:6px 14px;
  font-size:14px;
  font-family:'Sarabun',sans-serif;
  cursor:pointer;
  transition:all .15s;
}
.btn-add-row:hover{ 
  color:var(--blue);
  background:var(--blue-l);
}
.btn-rm{
  background:none;
  border:none;
  color:#CBD5E0;
  padding:3px 6px;
  cursor:pointer; 
  transition:all .15s;
  font-size:14px;
  border-radius: 45%; 
  transition: all 0.2s ease-in-out;
}
.btn-rm:hover{
  background:var(--red);
  color:var(--blue-l);
  z-index: 100;
  cursor: pointer;
  transition: all 0.2s ease-in-out; 
  text-shadow: 0px 0px 8px rgba(255, 255, 255, 0.8), 0px 0px 2px rgba(0, 0, 0, 0.2);
  
}
.remark-print {
  display: none;
  color:var(--text);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding:30px;
  font-size: 14px;
  font-style: italic;
  line-height: 2.5cap;
  color:var(--red)
}

/* ref input */
.ref-input-wrap{background:var(--blue-l);border:1.5px solid #BFDBFE;border-radius:10px;padding:14px 16px;margin-bottom:16px;display:flex;align-items:center;gap:12px;}
.ref-icon{font-size:22px;}
.ref-input-wrap label{font-size:14px;font-weight:700;color:var(--blue);margin-bottom:4px;}
.ref-input-wrap input{background:#fff;border:1.5px solid #93C5FD;border-radius:7px;padding:7px 12px;font-family:var(--mono);font-size:14px;font-weight:600;color:var(--blue);width:200px;}

/* summary card */
.summary-card{background:linear-gradient(135deg,var(--navy),var(--blue));border-radius:12px;padding:18px 20px;margin-bottom:16px;color:#fff;}
.summary-card h4{font-size:14px;font-weight:700;opacity:.7;margin-bottom:10px;}
.summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.sg-item label{font-size:14px;opacity:.55;font-weight:700;text-transform:uppercase;letter-spacing:.5px;}
.sg-item p{font-size:14px;font-weight:600;margin-top:1px;}

/* HOME stats */
.recent-table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}
.recent-table th{
  background:var(--surface);
  padding:9px 14px;
  font-size:14px;
  font-weight:700;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.5px;
  border-bottom:1px solid var(--border);
  text-align:left;
}
.recent-table td{
  padding:11px 14px;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
}
.recent-table tr:hover td{
  background:var(--blue-l);
}


/* quick actions */
.qa-card{cursor:pointer;border-radius:12px;padding:16px;text-align:center;transition:all .15s;border:1.5px solid transparent;}
.qa-card:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,.1);}

/* modal */
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:9000;align-items:center;justify-content:center;backdrop-filter:blur(4px);}
.modal-overlay.show{display:flex;animation:fadeIn .2s;}
@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}
.modal-box{background:#fff;border-radius:18px;padding:34px 38px;text-align:center;max-width:390px;width:90%;box-shadow:0 24px 80px rgba(0,0,0,.25);animation:popIn .2s ease;}
@keyframes popIn{from{transform:scale(.9);opacity:0;}to{transform:scale(1);opacity:1;}}
.modal-icon{font-size:46px;margin-bottom:12px;}
.modal-box h3{font-size:18px;font-weight:800;margin-bottom:6px;}
.modal-box p{font-size:14px;color:var(--muted);line-height:1.7;margin-bottom:14px;}
.modal-ref{font-family:var(--mono);font-size:14px;font-weight:700;padding:6px 16px;border-radius:7px;display:inline-block;margin-bottom:16px;}
.btn-modal-ok{background:var(--navy);color:#fff;border:none;padding:9px 24px;border-radius:9px;font-size:14px;font-weight:700;font-family:'Sarabun',sans-serif;cursor:pointer;}
.spinner{display:inline-block;width:14px;height:14px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;}
@keyframes spin{to{transform:rotate(360deg);}}

.sidebar-backdrop{display:none;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:199;}
.page-title{
  font-size:20px;
  font-weight:800;
  margin-bottom:3px;
}
.page-sub{
  font-size:16px;
  line-height: 2em;
  color:var(--muted);
  margin-left: 30px;
  margin-bottom:20px;
  margin-right: 50px;
}

@media(max-width:991px){
  .sidebar{transform:translateX(-100%);}
  .sidebar.open{transform:translateX(0);}
  .sidebar-backdrop.show{display:block;}
  .content{margin-left:0;}
  .topbar{left:0;}
  .hamburger{display:flex!important;}
  .stat-grid{grid-template-columns:1fr 1fr;}
}
@media(max-width:576px){
  .page{padding:14px 12px 60px;}
  .submit-panel{flex-direction:column;}
  .btn-sub{width:100%;justify-content:center;}
  .stepper-tab{padding:12px 12px;}
  .st-sub{display:none;}
  .summary-grid{grid-template-columns:1fr;}
}

/* ══════════════════════════════════════════
   Payment Way Cards & Detail
══════════════════════════════════════════ */
.pwy-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:12px;}
.pwy-card{
  position:relative;border:2px solid #dee2e6;border-radius:10px;
  padding:5px 15px 5px 15px;
  cursor:pointer;
  background:#fff;
  transition:border-color .15s,box-shadow .15s,background .15s;
}
.pwy-card:hover{border-color:#6ea8d8;background:#f7fbff;}
.pwy-card input[type=radio]{position:absolute;opacity:0;width:0;height:0;}
.pwy-card.selected{border-color:#1a3a5c;background:#eef4fc;box-shadow:0 0 0 3px rgba(26,58,92,.10);}
.pwy-card.locked{cursor:default;opacity:.5;}
.pwy-card.locked:hover{border-color:#dee2e6;background:#fff;}
.pwy-card.locked.selected{opacity:1;}
.pwy-card.locked-soft{cursor:default;opacity:.75;}
.pwy-card.locked-soft:hover{border-color:#dee2e6;background:#fff;}
.pwy-card.locked-soft.selected{opacity:1;}

.pwy-radio-dot{
  width:18px;height:18px;border-radius:50%;border:2px solid #adb5bd;
  display:inline-flex;align-items:center;justify-content:center;
  margin-right:8px;flex-shrink:0;transition:border-color .15s;
}
.pwy-card.selected .pwy-radio-dot{border-color:#1a3a5c;background:#1a3a5c;}
.pwy-card.selected .pwy-radio-dot::after{content:'';width:7px;height:7px;border-radius:50%;background:#fff;}

.pwy-top{display:flex;align-items:center;margin-bottom:8px;}
.pwy-badge{font-size:14px;font-weight:700;padding:2px 8px;border-radius:20px;margin-left:auto;}
.pwy-badge-1{background:#e3f4eb;color:#1a7a45;}
.pwy-badge-2{background:#fff3cd;color:#856404;}
.pwy-badge-3{background:#fce8e8;color:#8b1a1a;}
.pwy-badge-4{background:#f3e5f5;color:#6a1b9a;}
.pwy-grid.has-4{grid-template-columns:repeat(4,1fr);}
.pwy-icon-row{display:flex;align-items:center;gap:8px;margin-bottom:4px;}

.pwy-icon{font-size:20px; }
.pwy-title{font-weight:700;font-size:14px;}
.pwy-sub{font-size:14px;color:#6c757d;margin-top:3px;line-height:1.4;}
.pwy-lock-tag{
  position:absolute;top:8px;left:10px;background:#1a3a5c;color:#fff;
  border-radius:10px;font-size:14px;font-weight:700;padding:1px 7px;
  display:flex;align-items:center;gap:3px;
}

.pay-detail{
  /* background:#f8f9fa; */
  /* border:1px solid #dee2e6; */
  /* border-radius:8px; */
  /* padding:16px; */
  margin-top:12px;
  animation:payFadeIn .2s ease;
}

@keyframes payFadeIn{from{opacity:0;transform:translateY(-4px);}to{opacity:1;transform:translateY(0);}}
.authority-card-in{animation:payFadeIn .25s ease;}
.authority-card{display:flex;flex-direction:column; }
.authority-card>*{flex:0 0 auto;}
.authority-card>[id$="-panel"]{padding-top:12px;flex:0 0 auto;}
.action-panel-empty{margin-top:0 !important;}
.print-pay-way{font-size:0.75em;font-weight:400;opacity:.75;}

/* ── Home Summary ── */
.home-summary-chip{font-size:14px;font-weight:500;background:#f8fafc;border:1px solid var(--border);border-radius:20px;padding:3px 10px;color:var(--text);display:inline-flex;align-items:center;gap:4px;cursor:pointer;transition:background .15s,border-color .15s;}
#fp-badge-filter .home-summary-chip{border-radius:8px;}
.home-summary-chip:hover{background:#e0eeff;border-color:#93c5fd;}
.home-summary-chip.active{background:#1d4ed8;border-color:#1d4ed8;color:#fff;}
.home-summary-chip.active .badge{background:#bfdbfe !important;color:#1e3a8a !important;}
.home-summary-chip .badge{font-size:14px;min-width:20px;height:20px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;padding:0 4px;}
.home-summary-total{font-size:14px;color:var(--muted); margin-top: 2px}

/* ── Home Stepper ── */
.home-stepper{display:flex;align-items:center;gap:0;}
.home-step{display:flex;flex-direction:column;align-items:center;gap:3px;width:40px;flex-shrink:0;}
.home-step-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0;}
.home-step-dot.done{background:#1a3a5c;}
.home-step-dot.current{background:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.2);}
.home-step-dot.future{background:#dee2e6;}
.home-step-label{font-size:10px;color:#94a3b8;white-space:nowrap;text-align:center;max-width:48px;overflow:hidden;text-overflow:ellipsis;}
.home-step-label.current{color:#2563eb;font-weight:600;}
.home-step-line{height:1.5px;width:26px;flex-shrink:0;margin-bottom:14px;}
.home-step-line.done{background:#4a6fa5;}
.home-step-line.future{background:#dee2e6;}
.pay-detail .form-label{font-size:14px;}

.pay-info-box{
  display:flex;align-items:flex-start;gap:10px;
  border-radius:8px;padding:12px 14px;margin-bottom:14px;
}
.pay-info-box .bi{flex-shrink:0;margin-top:2px;font-size:15px;}
.pay-info-box-title{font-weight:700;font-size:14px;}
.pay-info-box-body{font-size:14px;margin-top:4px;line-height:1.7;}

.pay-field-ro{
  background:#e9ecef;border:1px solid #dee2e6;border-radius:6px;
  padding:7px 12px;font-size:14px;font-weight:600;color:#343a40;
  min-height:38px;display:flex;align-items:center;
}
.pay-field-ro .unit{font-size:14px;color:#6c757d;margin-left:4px;font-weight:400;}

.pay-diff-box{
  border-radius:8px;padding:10px 14px;font-size:14px;font-weight:600;
  display:flex;align-items:center;gap:8px;min-height:38px;
}
.pay-diff-refund{background:#d1e7dd;color:#0a3622;border:1px solid #a3cfbb;}
.pay-diff-extra {background:#f8d7da;color:#58151c;border:1px solid #f1aeb5;}
.pay-diff-even  {background:#e2e3e5;color:#41464b;border:1px solid #c4c8cb;}

.pay-status-row{
  display:flex;align-items:center;flex-wrap:wrap;gap:8px;
  background:#fff;border:1px solid #dee2e6;border-radius:8px;
  padding:10px 14px;margin-top:14px;
}
.pay-status-label{font-size:14px;font-weight:600;color:#495057;}
.pay-status-badge{
  display:inline-flex;align-items:center;gap:5px;
  padding:4px 12px;border-radius:20px;font-size:14px;font-weight:600;
}
.pay-status-pending{background:#fff3cd;color:#856404;}
.pay-status-paid   {background:#cfe2ff;color:#084298;}
.pay-status-cleared{background:#d1e7dd;color:#0a3622;}

@media(max-width:768px){
  .pwy-grid{grid-template-columns:1fr;}
}

.pay-verdict{
  display:flex;
  align-items:center;
  gap:14px;
  border-radius:8px;
  padding:5px 15px;
  border-left:5px solid;
  border-right:5px solid;
  background:#f8fafc;
}
.pay-verdict-icon-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  border-radius:50%;
  flex-shrink:0;
  font-size:18px;
}
.pay-verdict-body{
  display:flex;
  flex-direction:row;
  align-items:baseline;
  gap:8px;
  flex:1;
  flex-wrap:wrap;
}
.pay-verdict-label{
  font-size:14px;
  font-weight:500;
  opacity:.75;
}
.pay-verdict-amount{
  font-size:17px;font-weight:700;
}
.pay-verdict-sub{
  font-size:14px; font-weight:500; opacity:.75;
}
.pay-verdict-refund{
  border-color:var(--red); color:var(--red); background:var(--red-l);
}
.pay-verdict-extra{
  border-color:var(--cyan); color:var(--cyan); background:var(--cyan-l);
}
.pay-verdict-neutral{
  border-color:var(--muted); color:var(--muted); background:#f1f5f9;
}
#s2_w2_refund_dropzone.dz-over{border-color:var(--navy);background:rgba(26,58,92,.04);}

#s2_w2_refund_section { margin-top: 0 !important; }
#s2_w2_refund_bank_info > div { height: auto !important; max-height: none !important; }
#s2_w2_refund_dropzone { width: 280px !important; height: 340px !important; }
#s2_w2_refund_evident { height: auto !important; }

.pay-verdict-refund .pay-verdict-icon-wrap,
.pay-verdict-extra .pay-verdict-icon-wrap,
.pay-verdict-neutral .pay-verdict-icon-wrap{
  background:transparent;
}


/* ══════════════════════════════════════════
   Finance Payment Page (fp-*)
══════════════════════════════════════════ */

/* ลด padding เฉพาะหน้านี้ (ไม่แตะ .form-card ตัวหลักที่ใช้ทั่วระบบ) ให้เห็นเนื้อหาได้เต็มจอขึ้น */
.fp-filter-header { padding: 12px 16px; }
.fp-info-panel .form-card { padding: 14px 16px; }

/* บังคับให้ row นี้เคารพความสูงที่เหลือของจอจริงๆ (flex-fill เฉยๆ ไม่พอ เพราะ flex item
   จะขยายตามเนื้อหาข้างในโดย default ถ้าไม่มี min-height:0 กำกับ) */
#fp-layout { min-height: 0; }

/* Left list panel */
.fp-list-panel {
  width: 250px;
  background: var(--navy);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}
.fp-list-scroll { overflow-y: auto; flex: 1; }
.fp-list-empty  { padding: 40px 16px; text-align: center; color: rgba(255,255,255,0.4); font-size: 14px; }

.fp-list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 12px 4px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.fp-list-search i { color: rgba(255,255,255,0.4); font-size: 14px; flex-shrink: 0; }
.fp-list-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  font-family: 'Sarabun', sans-serif;
}
.fp-list-search input::placeholder { color: rgba(255,255,255,0.35); }

.fp-list-thead {
  padding: 8px 14px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.fp-list-thead span {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.fp-list-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.fp-list-pagination button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .12s;
}
.fp-list-pagination button:hover:not(:disabled) { background: rgba(255,255,255,0.14); color: #fff; }
.fp-list-pagination button:disabled { opacity: 0.3; cursor: default; }
#fp-page-info { font-size: 14px; color: rgba(255,255,255,0.55); font-family: var(--mono); }

/* Badge filter — อยู่ใน content header */
.fp-badge-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-badge-btn {
  font-size: 14px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  cursor: pointer;
  background: var(--fp-badge-bg);
  color: var(--fp-badge-color);
  border: 1.5px solid transparent;
  transition: border-color 0.12s, opacity 0.12s;
  user-select: none;
}
.fp-badge-btn:hover  { opacity: 0.75; }
.fp-badge-btn.active { border-color: var(--fp-badge-color); }
.fp-badge-count { opacity: 0.7; margin-left: 3px; }

/* List items */
.fp-list-item {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s;
  position: relative;
}
.fp-list-item:hover  { background: rgba(255,255,255,0.08); }
.fp-list-item.active::after {
  content: '›';
  position: absolute;
  right: 10px;
  top: 35%;
  transform: translateY(-50%);
  color: #60a5fa;
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}
.fp-li-row1 { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 3px; }
.fp-li-num  { font-size: 14px; font-weight: 700; color: #e2e8f0; }
.fp-li-pt   { font-size: 14px; font-weight: 600; padding: 2px 8px; border-radius: 10px; flex-shrink: 0; }

/* Right panels — เนื้อหายาวเกินให้ scroll ในตัวเอง แทนที่จะดันทั้ง row ให้สูงเกินจอ */
.fp-info-panel {
  background: var(--surface); padding: 0px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.fp-info-panel > * { flex: 1 1 auto; min-height: 0; }
#fp-main { display: flex; flex-direction: column; }
#fp-main > .row { flex: 1; min-height: 0; }
.fp-slip-panel { background: var(--surface); padding: 0px; }
.fp-center-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 320px; padding: 60px 24px; gap: 12px;
  color: var(--muted); text-align: center;
}

/* Info rows */
.fp-info-row { display: flex; align-items: baseline; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.fp-info-row:last-child { border-bottom: none; }
.fp-info-label { font-size: 14px; color: var(--muted); min-width: 120px; flex-shrink: 0; }
.fp-info-value { font-size: 14px; font-weight: 600; }
.fp-pay-alert  { border-radius: 8px; padding: 12px 16px; font-size: 14px; display: flex; gap: 10px; margin-bottom: 14px; }

/* Slip zones */
.fp-slip-zones-wrap { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; padding: 8px 0 4px; }
.fp-slip-zone       { display: flex; flex-direction: column; align-items: center; }
.fp-slip-zone .upload-zone { width: 260px; height: 300px; overflow: hidden; }
.fp-slip-zone-lbl   { font-size: 14px; font-weight: 700; margin-bottom: 0px; display: flex; align-items: center; gap: 6px; }
.fp-slip-readonly   {
  width: 260px; height: 300px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); overflow: hidden;
}

@keyframes fp-spin { to { transform: rotate(360deg); } }
.fp-spinning { animation: fp-spin 0.7s linear infinite; display: inline-block; }

/* Mobile */
@media (max-width: 767px) {
  .fp-list-panel { position: static; width: 100%; }
  #fp-layout { flex-direction: column; height: auto !important; overflow: visible; }
  .fp-list-scroll { max-height: 45vh; }
  .fp-info-panel, .fp-slip-panel { padding: 16px; border-right: none; border-bottom: 1px solid var(--border); }
  .fp-center-state { min-height: 160px; height: auto; }
}

/* ── summary.html (sm.js): การ์ดสรุปตัวเลข + กรอบกราฟ ── */
/* height คงที่ กัน label ยาว/สั้นทำให้แถวการ์ดฝั่ง "ให้" กับ "รับ" สูงไม่เท่ากัน */
.sm-card { padding: 14px 16px; margin-bottom: 0; height: 76px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.sm-chart-wrap { position: relative; height: 280px; }

/* ── finance-payment.html (fp.js): หัวข้อพื้นเข้ม ── */
#fp-main .sec-hdr.navy { background: var(--navy); color: #fff; border-left: none; }
#fp-main .sec-hdr.blue { background: var(--blue); color: #fff; border-left: none; }




