﻿/* 
^ Styling the drop-down menu for language switcher
* Auther : Fadi Nouh
* URL : https://bluebit.dev
* Repository: https://github.com/bluebits-academy/language-switcher
*/

@import url('https://fonts.googleapis.com/css2?family=Didact+Gothic&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css');

.lang-menu {
  width: 100px;
  text-align: right;
  font-weight: bold;
  margin-top: -25px;
  right: 30px;
  position: relative;
}
.lang-menu .selected-lang {
  display: flex;
  justify-content: space-between;
  line-height: 2;
  cursor: pointer;
}
.lang-menu .selected-lang:before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 32px;
  background-image: url(https://www.countryflags.io/us/flat/32.png);
  background-size: contain;
  background-repeat: no-repeat;
}

.lang-menu ul {
  display: none;
  background-color: #fff;
  border: 1px solid #f8f8f8;
  position: absolute;
  top: 45px;
  width: 125px;
  border-radius: 5px;
  box-shadow: 0px 1px 10px rgba(0, 0, 0, 0.2);
}

.lang-menu ul li {
  list-style: none;
  text-align: left;
  display: flex;
  justify-content: space-between;
}

.lang-menu ul li a {
  text-decoration: none;
  width: 125px;
  padding: 5px 10px;
  display: block;
}

.lang-menu ul li:hover {
  background-color: #f2f2f2;
}

.lang-menu ul li a:before {
  content: '';
  display: inline-block;
  width: 25px;
  height: 25px;
  vertical-align: middle;
  margin-right: 10px;
  background-size: contain;
  background-repeat: no-repeat;
}

.de:before {
  background-image: url(https://www.countryflags.io/de/flat/32.png);
}

.en:before {
  background-image: url(https://www.countryflags.io/us/flat/32.png);
}
.fr:before {
  background-image: url(https://www.countryflags.io/fr/flat/32.png);
}

.ar:before {
  background-image: url(https://www.countryflags.io/ae/flat/32.png);
}

.lang-menu:hover ul {
  display: block;
}

.badge-circle-custom {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  font-size: 12px;
  border-radius: 50%;
  color: inherit;
  border: 2px solid currentColor; /* Use currentColor to dynamically adapt */
  background-color: transparent; /* No background */
}

.auto-font {
  font-size: 23px; /* ปรับอัตโนมัติระหว่าง 14px ถึง 28px */
  white-space: nowrap;
  font-weight: bold;
  color: black;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}


/* สำหรับการตั้งค่าสีพื้นหลังและฟอนต์ */
.ql-editor {
  background-color: black !important; /* เปลี่ยนพื้นหลังเป็นสีดำ */
  color: white !important; /* ฟอนต์เป็นสีขาว */
  min-height: 200px; /* ตั้งความสูงของ editor */
}
/* สำหรับการตั้งค่าสีพื้นหลังและฟอนต์ */


/* สำหรับการเลือกข้อความ */
.ql-editor .ql-selected {
  background-color: #444444 !important; /* เปลี่ยนพื้นหลังเป็นสีเทาเข้มเมื่อคลุมข้อความ */
  color: #ffffff !important; /* ให้ฟอนต์เป็นสีขาว เมื่อคลุมข้อความ */
}

.tr-open {
  background-color: #ffffff;
}

.tr-suspend {
  background-color: #fff1d6; /* เหลืองอ่อน */
}

.tr-close {
  background-color: #fde2e2; /* แดงอ่อน */
}

.status-open { color: #2ecc71; font-weight: bold; }
.status-suspend { color: #f39c12; font-weight: bold; }
.status-close { color: #e74c3c; font-weight: bold; }

.pm-wrap {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.pm-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #009b77; /* เขียวในรูป */
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.2);
  transition: transform .08s ease, box-shadow .08s ease;
}

.pm-btn:hover {
  transform: scale(1.05);
}

.pm-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 0 rgba(0,0,0,.2);
}

/* ปรับเครื่องหมายให้เหมือนในรูป */
.pm-btn.plus { }
.pm-btn.minus { }

.btn-history-pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;

  height: 30px;
  padding: 0 12px;

  border-radius: 6px;           /* มุมโค้งแบบในรูป */
  border: 2px solid #0a8f74;    /* ขอบเขียวเข้ม */
  background: #0aa37f;          /* เขียวปุ่ม */
  color: #fff;

  font-size: 13px;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;
}

.btn-history-pill:hover{
  filter: brightness(0.97);
}

.btn-history-pill:active{
  transform: translateY(1px);
}

.credit-summary-bar{
  background: #fbf8e5;   /* ครีมแบบในภาพ */
  border-bottom: 1px solid #e3dfc7;

  padding: 16px 24px;
  margin-bottom: 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.credit-summary-left{
  color: #6e7d7d;
  font-size: 13px;
}

.credit-summary-right{
  font-size: 18px;
  font-weight: 800;
  color: #1f2d3d;
}

.credit-value{
  margin-left: 12px;
  color: #008c6a;
  font-weight: 900;
}

.credit-summary-right-group{
  display: flex;
  align-items: center;
  gap: 24px;        /* ระยะห่างระหว่างแต่ละช่อง */
}


/* กล่อง dialog */
.admin-dialog-paper{
  border-radius: 6px !important;
  overflow: hidden;
}

/* header สีเขียว */
.admin-dialog-header{
  background: #008c6a;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-dialog-title{
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}

/* content */
.admin-dialog-content{
  padding: 18px 22px !important;
}

.admin-form{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-field{
  width: 100%;
}

.admin-label{
  display: block;
  font-size: 12px;
  color: #4b5b5b;
  font-weight: 700;
  margin-bottom: 6px;
}

/* input ให้คล้ายในภาพ (พื้นเทาอ่อน) */
.admin-input input{
  background: #eef1f3;
  border-radius: 4px;
}

/* ข้อความช่วย */
.admin-help{
  margin-top: 6px;
  font-size: 11px;
  color: #7a8a8a;
}

/* ปุ่มล่าง */
.admin-dialog-actions{
  padding: 14px 22px 18px !important;
  justify-content: center !important;
  gap: 10px;
}

.btn-admin{
  height: 34px;
  min-width: 88px;
  border-radius: 4px;
  border: none;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
}

.btn-cancel{
  background: #ff2d2d;
}

.btn-save{
  background: #0aa37f;
}

.btn-admin:disabled{
  opacity: .6;
  cursor: not-allowed;
}

.history-dialog{
  padding:20px;
}

.history-title{
  font-size:22px;
  margin-bottom:10px;
}

.history-filter{
  display:flex;
  gap:12px;
  align-items:end;
  margin-bottom:15px;
}

.history-filter label{
  font-size:12px;
  color:#666;
  display:block;
}

.history-filter input{
  height:36px;
  padding:0 10px;
  border:1px solid #ccc;
  border-radius:4px;
}

.btn-search{
  background:#008f6a;
  color:#fff;
  border:0;
  padding:8px 16px;
  border-radius:4px;
}

.history-table{
  width:100%;
  border-collapse:collapse;
}

.history-table th{
  background:#008f6a;
  color:#fff;
  padding:8px;
}

.history-table td{
  padding:8px;
  border-bottom:1px solid #ddd;
  text-align:center;
}

.btn-close{
  background:#888;
  color:#fff;
  border:0;
  padding:8px 20px;
  border-radius:4px;
}

.admin-section{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}
.admin-section-title{
  font-weight: 700;
  margin-bottom: 10px;
}
.admin-grid-2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 768px){
  .admin-grid-2{ grid-template-columns: 1fr; }
}
.admin-radio{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.edit-layout{
  display: grid;
  grid-template-columns: 1.6fr 1fr; /* ซ้ายกว้าง ขวาแคบ */
  gap: 14px;
  align-items: start;
}

@media (max-width: 992px){
  .edit-layout{ grid-template-columns: 1fr; }
}

.edit-left{ display: grid; gap: 14px; }
.edit-right{ position: sticky; top: 10px; } /* ให้ประวัติยึดไว้ (ถ้าไม่ชอบ ลบได้) */

.history-section .history-table-wrap{
  max-height: 520px;      /* ปรับตามต้องการ */
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 10px;
}

.status-row{
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.edit-agent-dialog {
  width: 95vw !important;     /* จาก 96 → 80 */
  max-width: 1200px !important;  /* ล็อคไม่ให้ใหญ่เกิน */
  height: 70vh;
  max-height: 70vh;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.edit-layout {
  display: flex;
  height: 100%;
}

.edit-left {
  flex: 1.4;
  padding: 16px;
  overflow-y: auto;
}

.edit-right {
  flex: 1;
  border-left: 1px solid #ddd;
  padding: 16px;
  overflow-y: auto;
  background: #fafafa;
}

/* page */
.report-card {
  border-radius: 10px;
  overflow: hidden;
  padding-bottom: 14px;
}

/* breadcrumb + title (เหมือนภาพ) */
.report-breadcrumb {
  background: #fbf6dd;
  padding: 10px 16px;
  font-size: 12px;
  color: #5a5a5a;
}
.report-breadcrumb .sep { margin: 0 6px; opacity: .6; }
.report-breadcrumb .active { color: #1b8f74; font-weight: 700; }

.report-title {
  padding: 10px 16px 0 16px;
  font-size: 26px;
  font-weight: 800;
  color: #000;
}

/* filter */
.filter-wrap {
  padding: 14px 16px 10px 16px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 10px;
}

.filter-item label {
  display: block;
  font-size: 12px;
  color: #333;
  margin-bottom: 6px;
}

.filter-item.wide { min-width: 240px; }
.filter-item.grow { flex: 1; min-width: 260px; }

.date-input {
  height: 36px;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  padding: 0 10px;
  background: #fff;
  min-width: 180px;
}

.btn-search {
  background: #0a8f72 !important;
  color: #fff !important;
  height: 36px;
  padding: 0 18px !important;
  font-weight: 800 !important;
  border-radius: 4px !important;
}

/* quick buttons */
.quick-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.quick-btn {
  height: 32px;
  border: 0;
  border-radius: 4px;
  padding: 0 12px;
  background: #eaf4f1;
  color: #0a8f72;
  font-weight: 700;
  cursor: pointer;
}
.quick-btn.is-active {
  background: #0a8f72;
  color: #fff;
}
.quick-btn.is-muted {
  background: #eaf4f1;
  color: #0a8f72;
}
.quick-btn.is-disabled {
  background: #f1f1f1;
  color: #aaa;
  cursor: not-allowed;
}

/* mui small */
.mui-small .MuiOutlinedInput-root {
  background: #fff;
}

/* search box */
.search-wrapper .MuiOutlinedInput-root {
  background: #fff;
}

/* table block */
.table-block {
  margin: 8px 16px 0 16px;
}

.table-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
}

.flag-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(#d40000 0 33%, #ffffff 33% 66%, #0033a0 66% 100%);
  border: 1px solid rgba(0,0,0,.1);
}

.table-caption {
  font-size: 18px;
  font-weight: 800;
  color: #333;
}

/* scroll */
.table-scroll {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid #e3e3e3;
}

/* table */
.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1400px; /* ให้ได้ฟีลยาวเหมือนภาพ */
  background: #fff;
}

.report-table th,
.report-table td {
  border: 1px solid #e0e0e0;
  padding: 8px 10px;
  font-size: 13px;
}

.report-table thead th {
  background: #0a8f72;
  color: #fff;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
}

.report-table thead .th-group {
  background: #0a8f72;
}

.th-center { text-align: center; }
.th-right { text-align: right; }

.td-center { text-align: center; }
.td-right { text-align: right; white-space: nowrap; }
.td-link { color: #167a66; font-weight: 800; }

.td-empty {
  text-align: center;
  padding: 18px 8px;
  color: #777;
}

/* numbers colors */
.neg { color: #e53935; font-weight: 800; }
.pos { color: #1b8f74; font-weight: 800; }

/* total row */
.tr-total td {
  background: #79c8b6;
  font-weight: 900;
}
.breadcrumb-bar {
  font-size: 14px;
  margin-bottom: 6px;
  user-select: none;
  font-weight: 600;
}

/* ตัวที่กดได้ (เช่น javis) */
.crumb {
  color: #0a8f78;              /* เขียวแบบหัวตาราง */
  cursor: pointer;
  font-weight: 600;
}

.crumb:hover {
  text-decoration: underline;
  color: #0fbfa1;
}

/* ตัวปัจจุบัน (เช่น Spaceauto) */
.crumb-current {
  color: #0a8f78;
  font-weight: 800;
}

/* ตัวคั่น / */
.crumb-sep {
  margin: 0 6px;
  color: #9ccfc4;
  font-weight: 400;
}


.admin-dialog-paper {
  background: #ffffff !important;
  border-radius: 14px !important;
  box-shadow: 0 15px 40px rgba(0,0,0,.25) !important;
}
.admin-dialog-header {
  background: linear-gradient(135deg,#0f766e,#14b8a6);
  color: white;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
}
.admin-input {
  background: #f9fafb !important;
  border-radius: 8px !important;
}

.admin-input fieldset {
  border-color: #e5e7eb !important;
}
.btn-save {
  background: #14b8a6;
  color: white;
  box-shadow: none;
}

.btn-cancel {
  background: #f1f5f9;
  color: #0f172a;
}
.admin-summary-box {
  background: #ecfeff;
  border: 1px solid #67e8f9;
  color: #0f766e;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
}

.confirm-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;

  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 10px;

  cursor: pointer;
  user-select: none;
  transition: 0.15s ease;
}

.confirm-box:hover {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.confirm-box input[type='checkbox'] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: #14b8a6; /* modern browsers */
  cursor: pointer;
}

.confirm-text {
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.confirm-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
}

.confirm-box.is-checked {
  border-color: #14b8a6;
  background: #ecfeff;
}


/* กล่องรวมปุ่ม (เหมือนแท็บเลือกได้) */
.seg-wrap {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.seg-wrap--sm .seg-btn {
  padding: 8px 10px;
  font-size: 13px;
}

/* ปุ่มแต่ละอัน */
.seg-btn {
  flex: 1;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;

  font-weight: 700;
  color: #0f172a;
  cursor: pointer;

  transition: 0.15s ease;
  min-height: 38px;
}

/* hover ให้รู้ว่าคลิกได้ */
.seg-btn:hover:not(:disabled) {
  background: #e2e8f0;
}

/* active ชัดเจน */
.seg-btn.is-active {
  background: #0ea5e9;     /* สีหลักใหม่ ดู modern กว่าเขียว */
  color: #fff;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.18);
}

/* focus ring เวลา tab ด้วยคีย์บอร์ด */
.seg-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.25);
}

/* disabled */
.seg-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ✅ จำกัดผลเฉพาะ dialog นี้ */
.schedDlg .MuiPaper-root {
  background: #ffffff !important;
  color: #111827 !important; /* เทาเข้มอ่านง่าย */
  font-family: "Anuphan","Prompt","Sarabun",system-ui,-apple-system,"Segoe UI",Roboto,Arial !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ✅ กัน theme ที่ชอบทำตัวหนาแล้วพื้นดำ */
/* ✅ กัน CSS ธีมที่ทำเส้นทับ/underline แปลก ๆ */
.schedDlg,
.schedDlg * {
  text-decoration: none !important;
  text-decoration-line: none !important;
  text-decoration-thickness: initial !important;
  text-decoration-color: initial !important;
  box-shadow: none !important; /* บางธีมทำเส้นด้วย shadow */
}

/* ✅ กันพวก global ที่ชอบใส่พื้นหลังให้ b/strong */
.schedDlg b,
.schedDlg strong {
  background: transparent !important;
  color: inherit !important;
}

/* ✅ บังคับ Typography ให้สะอาด */
.schedDlg .MuiTypography-root {
  text-decoration: none !important;
  background: transparent !important;
  color: #111827 !important;
}

