
/* PC_TOPBAR_UNIFORM_30PCT_ALL_PAGES_V5
   แก้เฉพาะ PC: แถบบนทุกหน้าให้ขนาดเท่ากัน กระชับ ไม่ทับตัวอักษร และเพิ่มฟอนต์ ~30% */
@font-face{
  font-family:"TH Sarabun New";
  src:local("TH Sarabun New"), local("THSarabunNew"), local("Sarabun");
}

@media (min-width:901px){
  :root{
    --pc-topbar-h:78px;
    --pc-topbar-pad-x:18px;
    --pc-logo:52px;
    --pc-title:1.74rem;   /* เพิ่มจากเดิมประมาณ 30% */
    --pc-sub:1.12rem;     /* เพิ่มจากเดิมประมาณ 30% */
    --pc-btn:1.25rem;     /* เพิ่มจากเดิมประมาณ 30% */
  }

  body{
    font-family:"TH Sarabun New","TH SarabunPSK","Sarabun",Tahoma,sans-serif!important;
  }

  /* แถบบนทุกหน้ากลุ่ม PC ให้ใช้ขนาดเดียวกัน */
  .control-panel,
  header.topbar,
  .admin-topbar,
  nav.navbar{
    height:var(--pc-topbar-h)!important;
    min-height:var(--pc-topbar-h)!important;
    max-height:var(--pc-topbar-h)!important;
    padding:8px var(--pc-topbar-pad-x)!important;
    background:#0f172a!important;
    color:#fff!important;
    border-radius:0 0 18px 18px!important;
    border-bottom:1px solid rgba(255,255,255,.10)!important;
    box-shadow:0 12px 28px rgba(15,23,42,.16)!important;
    overflow:visible!important;
    font-family:"TH Sarabun New","TH SarabunPSK","Sarabun",Tahoma,sans-serif!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:14px!important;
  }

  header.topbar .container-fluid,
  .admin-topbar-inner,
  nav.navbar .container-fluid{
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    padding:0!important;
    margin:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:14px!important;
    overflow:visible!important;
    width:100%!important;
  }

  /* ฝั่งซ้าย: โลโก้ + ชื่อระบบ */
  .control-brand,
  .admin-brand,
  header.topbar .d-flex.align-items-center.gap-3.min-w-0,
  nav.navbar .navbar-brand{
    height:100%!important;
    min-height:0!important;
    min-width:0!important;
    max-width:calc(100vw - 460px)!important;
    display:flex!important;
    align-items:center!important;
    gap:10px!important;
    overflow:visible!important;
    flex:1 1 auto!important;
  }

  .mini-logo,
  .system-logo,
  .brand-logo,
  .admin-logo,
  nav.navbar .system-logo{
    width:var(--pc-logo)!important;
    height:var(--pc-logo)!important;
    min-width:var(--pc-logo)!important;
    flex:0 0 var(--pc-logo)!important;
    border-radius:50%!important;
    object-fit:contain!important;
    background:#fff!important;
    border:2px solid rgba(255,255,255,.92)!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    overflow:hidden!important;
  }

  .admin-logo img,
  .brand-logo img,
  .mini-logo img,
  .system-logo img,
  nav.navbar .system-logo img{
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
    display:block!important;
  }

  .brand-text,
  .admin-brand-text,
  header.topbar .min-w-0,
  nav.navbar .navbar-brand span{
    min-width:0!important;
    overflow:visible!important;
    display:block!important;
  }

  .brand-title,
  .admin-title,
  header.topbar h1,
  header.topbar h2,
  header.topbar h3,
  header.topbar h4,
  nav.navbar .navbar-brand .d-block,
  nav.navbar .navbar-brand > span > span{
    color:#fff!important;
    font-family:"TH Sarabun New","TH SarabunPSK","Sarabun",Tahoma,sans-serif!important;
    font-size:var(--pc-title)!important;
    line-height:1.12!important;
    font-weight:1000!important;
    height:auto!important;
    max-height:none!important;
    padding:0!important;
    margin:0!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    max-width:58vw!important;
    transform:none!important;
  }

  .brand-sub,
  .admin-subtitle,
  header.topbar .text-white-50,
  nav.navbar .navbar-brand small,
  nav.navbar .text-white-50{
    color:rgba(255,255,255,.78)!important;
    font-family:"TH Sarabun New","TH SarabunPSK","Sarabun",Tahoma,sans-serif!important;
    font-size:var(--pc-sub)!important;
    line-height:1.08!important;
    height:auto!important;
    max-height:none!important;
    padding:0!important;
    margin:2px 0 0 0!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    max-width:60vw!important;
    transform:none!important;
  }

  /* ฝั่งขวา: ปุ่ม/สถานะ ให้ขนาดเท่ากันทุกหน้า */
  .top-actions,
  .admin-top-actions,
  header.topbar .d-flex.gap-2.align-items-center,
  nav.navbar .container-fluid > .d-flex{
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:8px!important;
    flex:0 0 auto!important;
    max-width:44vw!important;
    overflow:visible!important;
    flex-wrap:nowrap!important;
  }

  .top-actions .btn,
  .top-actions .form-select,
  .top-actions .badge,
  .admin-top-actions .btn,
  header.topbar .btn,
  header.topbar .badge,
  nav.navbar .btn,
  nav.navbar .badge,
  .booth-select,
  .btn-fullscreen,
  .top-role-badge{
    height:42px!important;
    min-height:42px!important;
    max-height:42px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:12px!important;
    font-family:"TH Sarabun New","TH SarabunPSK","Sarabun",Tahoma,sans-serif!important;
    font-size:var(--pc-btn)!important;
    line-height:1!important;
    font-weight:1000!important;
    white-space:nowrap!important;
    padding:.34rem .72rem!important;
    margin:0!important;
  }

  .booth-select{
    width:148px!important;
    padding-right:1.8rem!important;
  }

  .top-role-badge{
    background:#fff!important;
    color:#111827!important;
    border:1px solid rgba(255,255,255,.55)!important;
  }

  /* หน้า booth.php เป็น fixed layout ต้องขยับ content ให้ตรงกับความสูงแถบบน */
  #main-content{
    inset:var(--pc-topbar-h) 0 0 0!important;
  }

  /* หน้าแอดมินที่ใช้ shell สูงเต็มจอ */
  body > .admin-main-shell{
    height:calc(100vh - var(--pc-topbar-h))!important;
    max-height:calc(100vh - var(--pc-topbar-h))!important;
  }

  /* ตารางรายชื่อแอดมิน: เพิ่มขนาด แต่ไม่ให้ตัดข้อความ */
  .admin-main-shell .table,
  #table-container .table{
    font-size:1.32rem!important;
  }

  .admin-main-shell .table th,
  #table-container .table th{
    font-size:1.22rem!important;
    font-weight:1000!important;
  }

  .admin-main-shell .table td,
  #table-container .table td{
    font-size:1.26rem!important;
    line-height:1.18!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    vertical-align:middle!important;
  }

  #table-container td.text-start,
  #table-container td:nth-child(4){
    min-width:300px!important;
    overflow-wrap:break-word!important;
  }

  #table-container td:last-child{
    min-width:230px!important;
    white-space:nowrap!important;
  }
}

/* Popup ทุกหน้าให้ใช้ TH Sarabun และขนาดมาตรฐานอ่านง่าย */
.swal2-container,
.swal2-popup,
.swal2-title,
.swal2-html-container,
.swal2-actions,
.swal2-confirm,
.swal2-cancel,
.swal2-deny,
.swal2-input,
.swal2-select,
.swal2-textarea,
.swal2-validation-message{
  font-family:"TH Sarabun New","TH SarabunPSK","Sarabun",Tahoma,sans-serif!important;
}

.swal2-popup{
  font-size:1.25rem!important;
  border-radius:20px!important;
}

.swal2-title{
  font-size:2rem!important;
  line-height:1.2!important;
  font-weight:1000!important;
}

.swal2-html-container{
  font-size:1.22rem!important;
  line-height:1.3!important;
}

.swal2-confirm,
.swal2-cancel,
.swal2-deny{
  font-size:1.15rem!important;
  line-height:1.1!important;
  font-weight:1000!important;
  border-radius:12px!important;
  padding:.52rem 1.05rem!important;
}

.swal2-input,
.swal2-select,
.swal2-textarea{
  font-size:1.15rem!important;
  line-height:1.2!important;
}

@media (max-width:720px){
  .swal2-popup{
    width:calc(100vw - 24px)!important;
    max-width:calc(100vw - 24px)!important;
    font-size:1.08rem!important;
  }
  .swal2-title{font-size:1.58rem!important}
  .swal2-html-container{font-size:1.05rem!important}
  .swal2-confirm,.swal2-cancel,.swal2-deny{font-size:1rem!important}
}
