/* ปฏิทินแบบ Outlook (2026-11-14) — คัดลอกจาก puacar/assets/css/outlook-cal.css (ชุดเดียวกับ puaroom gcal.css)
   ใช้กับปฏิทินการจองห้องในหน้าเข้าสู่ระบบ (index.php ใส่คลาส .gc-cal) — สีของรายการตามห้อง (ชุดสีเดียวกับ puaroom)
   รายการ = พื้นสีอ่อน (--gc-soft) + แถบสีด้านซ้าย, "+n" เป็นแถบเทา, วันนี้มีกรอบ + เลขในวงกลม (สีหลักของ SSO) */
html body .gc-cal {
  --gc-blue: #0f6cbd; --gc-blue-soft: #ebf3fc; --gc-blue-ink: #115ea3;
  --gc-ink: #242424; --gc-muted: #616161; --gc-line: #e0e0e0; --gc-hover: #f5f5f5; --gc-more: #f0f0f0;
  --fc-border-color: var(--gc-line);
  --fc-today-bg-color: transparent;
  --fc-page-bg-color: #fff;
  --fc-neutral-bg-color: #fafafa;
  --fc-now-indicator-color: #c50f1f;
  --fc-highlight-color: rgba(15, 108, 189, .1);
  --fc-event-border-color: transparent;
  color: var(--gc-ink);
  font-size: .875rem;
}
html body .gc-cal a { color: inherit; text-decoration: none; }

/* ---------- แถบเครื่องมือ: [📅 วันนี้] ‹ › เดือน ปี ............ [เดือน|สัปดาห์|วัน] ---------- */
html body .gc-cal .fc-header-toolbar { margin-bottom: .75rem !important; gap: .5rem; flex-wrap: wrap; }
html body .gc-cal .fc-toolbar-chunk { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
html body .gc-cal .fc-toolbar-title {
  font-size: 1.25rem !important; font-weight: 600; color: var(--gc-ink); margin: 0 0 0 .5rem; white-space: nowrap;
}
html body .gc-cal .fc-button,
html body .gc-cal .fc-button-primary {
  background: #fff !important; border: 1px solid #d1d1d1 !important; color: var(--gc-ink) !important;
  font-weight: 500; font-size: .875rem; line-height: 1.2; padding: .4rem .85rem; border-radius: 4px; white-space: nowrap;
  box-shadow: none !important; text-transform: none; transition: background .12s;
}
html body .gc-cal .fc-button:hover { background: var(--gc-hover) !important; }
html body .gc-cal .fc-button:focus-visible { outline: 2px solid var(--gc-blue); outline-offset: 1px; }
html body .gc-cal .fc-button:disabled { opacity: 1; color: var(--gc-ink) !important; background: #fff !important; }
/* ปุ่ม "วันนี้" มีไอคอนปฏิทิน */
html body .gc-cal .fc-today-button { display: inline-flex; align-items: center; gap: .45rem; margin-right: .35rem !important; }
html body .gc-cal .fc-today-button::before {
  content: ""; width: 15px; height: 15px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 .5a.5.5 0 0 1 1 0V1h6V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5zM2 5v8a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V5H2zm5 3h2v2H7V8z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 .5a.5.5 0 0 1 1 0V1h6V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5zM2 5v8a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V5H2zm5 3h2v2H7V8z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* ‹ › ไม่มีขอบ */
html body .gc-cal .fc-prev-button,
html body .gc-cal .fc-next-button {
  border-color: transparent !important; border-radius: 4px !important; width: 2rem; height: 2rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; color: var(--gc-ink) !important;
}
html body .gc-cal .fc-button-group { gap: 0; }
html body .gc-cal .fc-button-group > .fc-prev-button,
html body .gc-cal .fc-button-group > .fc-next-button { margin: 0 !important; }
/* ปุ่มเลือกมุมมอง: อันที่เลือกเป็นพื้นเทาอ่อน + ขอบ (แบบปุ่ม Month ของ Outlook) */
html body .gc-cal .fc-toolbar-chunk:last-child .fc-button-group { gap: .25rem; }
html body .gc-cal .fc-toolbar-chunk:last-child .fc-button-group .fc-button { border-color: transparent !important; border-radius: 4px !important; margin: 0 !important; }
html body .gc-cal .fc-button-active,
html body .gc-cal .fc-button-primary:not(:disabled).fc-button-active {
  background: #ebebeb !important; color: var(--gc-ink) !important; border-color: #d1d1d1 !important; font-weight: 600;
  position: relative; z-index: 1;
}

/* ---------- กรอบ ---------- */
html body .gc-cal .fc-view-harness { border: 0 !important; border-radius: 0 !important; overflow: visible; }
html body .gc-cal .fc-scrollgrid { border-color: var(--gc-line); border-radius: 4px; overflow: hidden; }
html body .gc-cal .fc-theme-standard td,
html body .gc-cal .fc-theme-standard th,
html body .gc-cal.fc-theme-standard td,
html body .gc-cal.fc-theme-standard th { border-color: var(--gc-line); }

/* ---------- มุมมองเดือน ---------- */
html body .gc-cal .fc-col-header-cell { border-left-color: transparent; border-right-color: transparent; background: #fff; }
html body .gc-cal .fc-col-header-cell-cushion {
  display: block; padding: .45rem .5rem !important; font-size: .78rem !important; font-weight: 400;
  color: var(--gc-muted) !important; text-align: left;
}
html body .gc-cal .fc-daygrid-day { background: #fff; }
html body .gc-cal .fc-daygrid-day.fc-day-today { background: #fff !important; box-shadow: inset 0 0 0 1px var(--gc-blue); }
html body .gc-cal .fc-daygrid-day-top { flex-direction: row; justify-content: flex-start; padding: 4px 4px 0; }
html body .gc-cal .fc-daygrid-day-number {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.6rem; height: 1.6rem; padding: 0 .3rem !important; border-radius: 999px;
  font-size: .8rem; font-weight: 400; color: var(--gc-ink); line-height: 1;
}
html body .gc-cal a.fc-daygrid-day-number:hover { background: var(--gc-hover); }
/* FullCalendar 5 ทิ้งลิงก์เลขวันที่ว่างไว้เมื่อเนื้อหาช่องเปลี่ยนเป็น html ("1 พ.ย.") หลังเปลี่ยนเดือน */
html body .gc-cal .fc-daygrid-day-number:empty { display: none; }
html body .gc-cal .gc-dnum-m {
  display: inline-flex; align-items: center; gap: .2rem; height: 1.6rem; padding: 0 .3rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--gc-ink); line-height: 1; white-space: nowrap;
}
html body .gc-cal .gc-dnum-m small { font-size: inherit; font-weight: 600; }
html body .gc-cal .fc-day-today .gc-dnum-m { background: var(--gc-blue); color: #fff; }
html body .gc-cal .fc-day-other .fc-daygrid-day-number { color: var(--gc-muted); opacity: 1; }
html body .gc-cal .fc-day-other .fc-daygrid-day-top { opacity: 1; }
html body .gc-cal .fc-day-today .fc-daygrid-day-number { background: var(--gc-blue) !important; color: #fff !important; font-weight: 600; }
html body .gc-cal .fc-daygrid-day-frame { min-height: 6.5rem; }
html body .gc-cal .fc-daygrid-day-events { margin: 2px 0 0; }

/* รายการจอง = แถบสีอ่อนของห้อง + เส้นสีห้องด้านซ้าย + เวลา + ชื่อ */
html body .gc-cal .fc-daygrid-event {
  margin: 0 4px 3px !important; border-radius: 3px; font-size: .78rem; cursor: pointer; padding: 2px 6px; line-height: 1.35;
}
html body .gc-cal .fc-daygrid-dot-event,
html body .gc-cal .fc-daygrid-block-event {
  color: var(--gc-ink); background: var(--gc-soft, #e8f1fb) !important; border: 0 !important;
  box-shadow: inset 3px 0 0 var(--gc, var(--gc-blue));
}
html body .gc-cal .fc-daygrid-dot-event:hover,
html body .gc-cal .fc-daygrid-block-event:hover { filter: brightness(.96); }
html body .gc-cal .fc-daygrid-event-dot { display: none; }
html body .gc-cal .fc-daygrid-dot-event .fc-event-time { font-weight: 400; color: var(--gc-ink); margin-right: 4px; }
html body .gc-cal .fc-daygrid-dot-event .fc-event-title,
html body .gc-cal .fc-daygrid-block-event .fc-event-title { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .gc-cal .fc-daygrid-block-event .fc-event-main { color: var(--gc-ink); }

/* "+n" = แถบเทาเต็มความกว้าง */
html body .gc-cal .fc-daygrid-day-bottom { margin: 0 !important; padding: 0 !important; }
html body .gc-cal .fc-daygrid-more-link,
html body .gc-cal .fc-more-link {
  display: block; margin: 0 4px 3px; padding: 2px 6px; border-radius: 3px; float: none !important;
  font-size: .78rem; font-weight: 400; text-align: center; background: var(--gc-more); color: var(--gc-ink) !important;
}
html body .gc-cal .fc-daygrid-more-link:hover { background: #e6e6e6; }
html body .gc-cal .fc-popover {
  border: 1px solid var(--gc-line) !important; border-radius: 6px !important; overflow: hidden;
  box-shadow: 0 8px 16px rgba(0, 0, 0, .14), 0 0 2px rgba(0, 0, 0, .12) !important;
}
html body .gc-cal .fc-popover-header { background: #fff !important; padding: .6rem .75rem .25rem; font-size: .85rem; font-weight: 600; color: var(--gc-ink); }
html body .gc-cal .fc-popover-body { padding: .25rem 0 .5rem; min-width: 220px; }

/* ---------- มุมมองสัปดาห์/วัน ---------- */
html body .gc-cal .fc-timegrid .fc-col-header-cell-cushion { display: flex; flex-direction: row; align-items: baseline; gap: .4rem; padding: .45rem .5rem !important; }
html body .gc-cal .gc-dow { font-size: .78rem; font-weight: 400; color: var(--gc-muted); order: 2; }
html body .gc-cal .gc-dnum {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; border-radius: 50%;
  font-size: 1.25rem; font-weight: 600; color: var(--gc-ink); order: 1;
}
html body .gc-cal .fc-day-today .gc-dow { color: var(--gc-blue); font-weight: 600; }
html body .gc-cal .fc-day-today .gc-dnum { background: var(--gc-blue); color: #fff; }
html body .gc-cal .fc-timegrid-col.fc-day-today { background: #f5f9fe !important; }
html body .gc-cal .fc-timegrid-slot { height: 2.6rem; border-bottom: 0; }
html body .gc-cal .fc-timegrid-slot-minor { border-top-style: dotted !important; }
html body .gc-cal .fc-timegrid-slot-label-cushion { font-size: .7rem; color: var(--gc-muted); padding: 0 .5rem 0 .25rem; position: relative; top: -.7em; background: #fff; }
html body .gc-cal .fc-timegrid-slot-label { border-color: transparent !important; vertical-align: top; }
html body .gc-cal .fc-timegrid-axis { border-color: transparent !important; }
html body .gc-cal .fc-timegrid-event-harness-inset .fc-timegrid-event,
html body .gc-cal .fc-timegrid-event { box-shadow: inset 3px 0 0 var(--gc), 0 0 0 1px #fff; }
html body .gc-cal .fc-timegrid-event {
  background: var(--gc-soft, #e8f1fb) !important; border: 0 !important; border-radius: 3px; cursor: pointer; margin-right: 4px; padding: 0;
}
html body .gc-cal .fc-timegrid-event .fc-event-main { padding: 3px 6px 3px 9px; color: var(--gc-ink); }
html body .gc-cal .fc-timegrid-event .fc-event-main-frame { flex-direction: column; justify-content: flex-start; overflow: hidden; }
html body .gc-cal .fc-timegrid-event .fc-event-title-container { order: 1; flex: none; }
html body .gc-cal .fc-timegrid-event .fc-event-time { order: 2; }
html body .gc-cal .fc-timegrid-event .fc-event-title { font-weight: 600; font-size: .75rem; line-height: 1.3; }
html body .gc-cal .fc-timegrid-event .fc-event-time { font-size: .7rem; color: var(--gc-muted); margin: 0; }
html body .gc-cal .fc-timegrid-now-indicator-line { border-width: 2px 0 0; }
html body .gc-cal .fc-timegrid-now-indicator-line::before {
  content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: #c50f1f;
}
html body .gc-cal .fc-timegrid-now-indicator-arrow { display: none; }

/* ---------- มุมมองกำหนดการ (list) ---------- */
html body .gc-cal .fc-list { border: 0 !important; }
html body .gc-cal .fc-list-day-cushion { background: #fff !important; padding: .9rem .75rem .35rem !important; }
html body .gc-cal .fc-list-day-text,
html body .gc-cal .fc-list-day-side-text { font-size: .8rem; font-weight: 500; color: var(--gc-muted); }
html body .gc-cal .fc-list-day.fc-day-today .fc-list-day-text,
html body .gc-cal .fc-list-day.fc-day-today .fc-list-day-side-text { color: var(--gc-blue); }
html body .gc-cal .fc-list-event td { border-color: transparent; padding: .45rem .75rem; font-size: .85rem; }
html body .gc-cal .fc-list-event:hover td { background: var(--gc-hover) !important; }
html body .gc-cal .fc-list-event { cursor: pointer; }
html body .gc-cal .fc-list-event-dot { border: 6px solid var(--gc, var(--gc-blue)) !important; border-radius: 50%; }
html body .gc-cal .fc-list-event-time { color: var(--gc-muted); }
html body .gc-cal .fc-list-event-title { font-weight: 500; }
html body .gc-cal .fc-list-empty { background: #fff; color: var(--gc-muted); }

/* ---------- สถานะ (สีตามห้องเสมอ) ---------- */
/* รออนุมัติ = พื้นขาว + ขอบสีห้อง (แบบรายการ "ยังไม่ยืนยัน" ใน Outlook) */
html body .gc-cal .gc-pending.fc-daygrid-dot-event,
html body .gc-cal .gc-pending.fc-daygrid-block-event,
html body .gc-cal .gc-pending.fc-timegrid-event {
  background: #fff !important; box-shadow: inset 3px 0 0 var(--gc), inset 0 0 0 1px var(--gc) !important;
}
html body .gc-cal .gc-pending .fc-daygrid-event-dot { box-sizing: border-box; border-width: 2px !important; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
html body .gc-cal .gc-pending .fc-list-event-dot { border-width: 2px !important; width: 12px; height: 12px; background: #fff; }
/* ถูกปฏิเสธ/ยกเลิก = จาง + ขีดฆ่า */
html body .gc-cal .gc-rejected,
html body .gc-cal .gc-cancelled { opacity: .55; }
html body .gc-cal .gc-rejected .fc-event-title,
html body .gc-cal .gc-cancelled .fc-event-title,
html body .gc-cal .gc-rejected .fc-list-event-title,
html body .gc-cal .gc-cancelled .fc-list-event-title { text-decoration: line-through; }

/* ---------- ปฏิทินเล็ก (แดชบอร์ด/ฟอร์มจอง) ---------- */
html body .gc-mini { font-size: .8rem; }
html body .gc-mini .fc-header-toolbar { margin-bottom: .5rem !important; flex-wrap: nowrap; }
html body .gc-mini .fc-toolbar-title { font-size: 1rem !important; font-weight: 500; margin: 0; }
html body .gc-mini .fc-today-button { padding: .3rem .7rem; font-size: .78rem; }
html body .gc-mini .fc-prev-button,
html body .gc-mini .fc-next-button { width: 1.9rem; height: 1.9rem; }
html body .gc-mini .fc-scrollgrid { border: 0; }
html body .gc-mini .fc-scrollgrid td,
html body .gc-mini .fc-scrollgrid th { border-color: transparent !important; }
html body .gc-mini .fc-daygrid-day-frame { min-height: 2.6rem; }
html body .gc-mini .fc-daygrid-day-top { padding-top: 2px; }
html body .gc-mini .fc-daygrid-day-number { min-width: 1.6rem; height: 1.6rem; font-size: .72rem; }
html body .gc-mini .fc-col-header-cell-cushion { padding: .3rem 0 !important; }
html body .gc-mini .fc-toolbar-chunk { flex-wrap: nowrap; }
html body .gc-mini .fc-toolbar-chunk:first-child { min-width: 0; flex: 1 1 auto; }
html body .gc-mini .fc-toolbar-chunk:last-child { flex: none; }
html body .gc-mini .fc-toolbar-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* จุดสีแทนรายการ: ปฏิทินเล็ก และมุมมองเดือนบนมือถือ */
html body .gc-mini .fc-daygrid-day-events { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin: 0 2px 3px !important; min-height: 6px; }
html body .gc-mini .fc-daygrid-event-harness { margin: 0 !important; }
html body .gc-mini .fc-daygrid-day-bottom { display: none; }
html body .gc-mini .fc-daygrid-event { margin: 0 !important; padding: 0 !important; background: transparent !important; box-shadow: none !important; }
html body .gc-mini .fc-daygrid-event-dot { display: inline-block; margin: 0; border-width: 3px !important; }
html body .gc-mini .fc-daygrid-day.fc-day-today { box-shadow: none; }
html body .gc-mini .fc-daygrid-day-top { justify-content: center; }
html body .gc-mini .fc-daygrid-event .fc-event-time,
html body .gc-mini .fc-daygrid-event .fc-event-title { display: none; }
html body .gc-mini .gc-pending .fc-daygrid-event-dot { box-sizing: border-box; width: 6px; height: 6px; border-width: 1.5px !important; border-radius: 50%; }

/* ---------- คำอธิบายสี ---------- */
.gc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; margin: 0 0 .75rem; font-size: .8rem; color: #242424; justify-content: flex-start !important; }
.gc-lg-item { display: inline-flex; align-items: center; gap: .4rem; margin: 0 !important; }
.gc-lg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gc); flex: none; }
.gc-lg-sep { width: 1px; height: 1rem; background: #e0e0e0; }
.gc-lg-chip { width: 22px; height: 12px; border-radius: 2px; background: #cde6f7; box-shadow: inset 3px 0 0 #039be5; flex: none; }
.gc-lg-chip.gc-pending { background: #fff; box-shadow: inset 3px 0 0 #039be5, inset 0 0 0 1px #039be5; }
.gc-lg-chip.gc-rejected { opacity: .45; }

/* ---------- จอเล็ก ---------- */
@media (max-width: 767.98px) {
  html body .gc-cal:not(.gc-mini) .fc-header-toolbar { flex-direction: column; align-items: stretch; }
  html body .gc-cal:not(.gc-mini) .fc-toolbar-chunk { justify-content: space-between; }
  html body .gc-cal .fc-toolbar-title { font-size: 1.15rem !important; }
  html body .gc-cal .fc-daygrid-day-frame { min-height: 4.5rem; }
  html body .gc-cal .fc-daygrid-dot-event .fc-event-time,
  html body .gc-cal .fc-daygrid-dot-event .fc-event-title { display: none; }
  html body .gc-cal .fc-daygrid-day-events { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; margin: 0 2px 4px !important; }
  html body .gc-cal .fc-daygrid-event-harness { margin: 0 !important; }
  html body .gc-cal .fc-daygrid-dot-event { margin: 0 !important; padding: 3px 2px !important; background: transparent !important; box-shadow: none !important; }
  html body .gc-cal .fc-daygrid-event-dot { display: inline-block; margin: 0; border: 4px solid var(--gc) !important; }
  html body .gc-cal .fc-daygrid-day-top { justify-content: center; }
  html body .gc-cal .fc-daygrid-day-bottom { width: 100%; text-align: center; }
  html body .gc-cal .fc-daygrid-more-link { margin: 0; padding: 0 2px; font-size: .68rem; background: transparent; color: var(--gc-muted) !important; }
  html body .gc-cal .gc-dnum { min-width: 1.7rem; height: 1.7rem; font-size: 1rem; }
  html body .gc-cal .fc-timegrid .fc-col-header-cell-cushion { flex-direction: column; align-items: center; gap: 0; padding: .35rem 0 !important; }
  html body .gc-cal .fc-toolbar-chunk:last-child .fc-button-group { width: 100%; }
  html body .gc-cal .fc-toolbar-chunk:last-child .fc-button-group .fc-button { flex: 1; padding-left: .4rem; padding-right: .4rem; }
}

/* คำอธิบายสีใต้ปฏิทิน (.calendar-legend เดิม) → ตัวอย่างแบบแถบรายการ */
.calendar-legend .legend-color { width: 22px; height: 12px; border-radius: 2px; background: var(--soft, #e8f1fb) !important; box-shadow: inset 3px 0 0 var(--c); }
.calendar-legend .legend-color.is-outline { background: #fff !important; box-shadow: inset 3px 0 0 var(--c), inset 0 0 0 1px var(--c); }

/* แถว "ตลอดวัน" ในมุมมองสัปดาห์ และรายการหลายวัน */
html body .gc-cal .fc-dayGridMonth-view .fc-daygrid-day-frame { min-height: 6.5rem; }
html body .gc-cal .fc-timegrid .fc-daygrid-day-frame { min-height: 0; }
html body .gc-cal .fc-timegrid .fc-daygrid-day-top { display: none; }
html body .gc-cal .fc-timegrid .fc-daygrid-day.fc-day-today { box-shadow: none; }
html body .gc-cal .fc-timegrid-axis-cushion { font-size: .7rem; color: var(--gc-muted); }
html body .gc-cal .fc-daygrid-block-event .fc-event-time { white-space: nowrap; flex: none; font-weight: 400; }
html body .gc-cal .fc-daygrid-block-event .fc-event-main-frame { overflow: hidden; }

/* มือถือ: รายการรออนุมัติเป็นวงกลมกลวง ไม่มีกรอบ chip ล้อมรอบ */
@media (max-width: 767.98px) {
  html body .gc-cal .gc-pending.fc-daygrid-dot-event { background: transparent !important; box-shadow: none !important; }
  html body .gc-cal .gc-pending .fc-daygrid-event-dot { border-width: 2px !important; width: 9px; height: 9px; box-sizing: border-box; border-radius: 50%; background: #fff; }
  html body .gc-cal .fc-daygrid-block-event .fc-event-time { display: none; }
}
