:root {
  
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-light: #fff7ed;
  --primary-glow: rgba(234, 88, 12, 0.22);
  --secondary: #4f46e5;
  --secondary-hover: #4338ca;
  --secondary-light: #eef2ff;
  --secondary-glow: rgba(79, 70, 229, 0.2);
  --accent: #0284c7;
  --accent-light: #f0f9ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-light: rgba(226, 232, 240, 0.8);
  --surface: rgba(255, 255, 255, 0.94);
  --surface-card: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.8);
  --radius-card: 28px;
  --radius-panel: 22px;
  --radius-btn: 14px;
  --font-ui: "Leelawadee UI", "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-subtle: 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 12px 36px rgba(15, 23, 42, 0.07);
  --shadow-soft: 0 24px 64px -12px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.7);
  --shadow-glow: 0 10px 28px rgba(234, 88, 12, 0.28);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body,
button,
input,
select,
textarea,
.fc {
  font-family: var(--font-ui);
}

body {
  min-height: 100vh;
  background-color: #f8fafc;
  background-image:
    radial-gradient(at 0% 0%, rgba(249, 115, 22, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(79, 70, 229, 0.1) 0px, transparent 55%),
    radial-gradient(at 50% 100%, rgba(14, 165, 233, 0.07) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--ink);
  padding: 16px 24px 115px;
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.main-card {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  padding: clamp(20px, 2vw, 32px);
  transition: all 0.3s ease;
}

.page-header {
  position: relative;
  padding: 20px 24px;
  border-radius: var(--radius-panel);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.88));
  border: 1px solid var(--line-light);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}

.page-header::after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  right: -90px;
  top: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.08) 0%, rgba(79, 70, 229, 0.05) 70%, transparent 100%);
  pointer-events: none;
}

.brand-block,
.brand-copy,
.header-status {
  min-width: 0;
}

.brand-block {
  flex: 1 1 auto;
}

.brand-copy {
  flex: 1 1 360px;
}

.brand-copy h2 {
  color: var(--ink);
  font-weight: 800;
  font-size: clamp(1.45rem, 2.5vw, 2rem) !important;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin: 0;
  background: linear-gradient(135deg, #0f172a 20%, #4338ca 65%, #ea580c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-copy #siteSubtitle {
  color: var(--muted) !important;
  font-weight: 500;
  font-size: 0.85rem;
}

.brand-copy #siteWarning {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--danger-light);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.logo-img {
  height: 92px;
  width: auto;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.05));
  transition: transform 0.25s ease;
}

.logo-img:hover {
  transform: scale(1.03);
}

.header-status {
  position: relative;
  z-index: 1;
  align-content: center;
  justify-content: flex-end !important;
  max-width: 100%;
}

.mode-badge,
.lang-btn {
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-subtle);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.lang-btn {
  cursor: pointer;
  border-color: rgba(79, 70, 229, 0.25);
  color: var(--secondary);
}

.lang-btn:hover {
  background: var(--secondary);
  color: #ffffff;
  border-color: var(--secondary);
  box-shadow: 0 6px 18px var(--secondary-glow);
  transform: translateY(-2px);
}

.lang-btn .lang-active {
  font-weight: 800;
  opacity: 1;
}

.lang-btn .lang-inactive {
  opacity: 0.5;
}

.mode-badge:hover {
  box-shadow: var(--shadow-card);
}

.calendar-panel {
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.calendar-guidance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 4px 18px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 16px;
}

.calendar-guidance-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.calendar-eyebrow {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.calendar-eyebrow i {
  color: var(--primary);
}

.calendar-hint {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.calendar-quick-book {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: var(--radius-btn);
  background: linear-gradient(135deg, var(--primary), #f97316);
  color: #fff;
  font: 700 0.88rem var(--font-ui);
  box-shadow: var(--shadow-glow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  flex: 0 0 auto;
}

.calendar-quick-book:hover,
.calendar-quick-book:focus-visible {
  background: linear-gradient(135deg, var(--primary-hover), #ea580c);
  box-shadow: 0 12px 28px rgba(234, 88, 12, 0.38);
  transform: translateY(-2px);
}

#calendar {
  margin-top: 0 !important;
  min-height: 700px;
  contain-intrinsic-size: 700px;
  contain: layout style;
}

#calendar .fc {
  --fc-border-color: #e2e8f0;
  --fc-page-bg-color: #ffffff;
  --fc-neutral-bg-color: #f8fafc;
}

#calendar .fc-theme-standard .fc-scrollgrid {
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03) !important;
}

#calendar .fc-theme-standard td,
#calendar .fc-theme-standard th {
  border-color: #e8edf4 !important;
}

#calendar .fc-header-toolbar.fc-toolbar {
  margin-bottom: 0 !important;
  padding: 6px 4px 20px !important;
  border-bottom: 1.5px solid #f1f5f9 !important;
  gap: 12px;
  align-items: center;
}

#calendar .fc-toolbar-title {
  color: #0f172a !important;
  font-size: clamp(1.35rem, 2.3vw, 1.75rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em;
}

#calendar .fc-prev-button,
#calendar .fc-next-button {
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border-radius: 12px !important;
  color: #334155 !important;
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#calendar .fc-prev-button:hover,
#calendar .fc-next-button:hover {
  color: #0f172a !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

#calendar .fc-prev-button:active,
#calendar .fc-next-button:active {
  transform: scale(0.95) !important;
}

#calendar .fc-today-button {
  min-height: 40px !important;
  padding: 8px 18px !important;
  border-radius: 12px !important;
  color: #334155 !important;
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  font: 700 0.88rem var(--font-ui) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#calendar .fc-today-button:hover:not(:disabled) {
  color: #ea580c !important;
  background: #fff7ed !important;
  border-color: #fdba74 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.18) !important;
}

#calendar .fc-today-button:disabled {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #94a3b8 !important;
  opacity: 0.65;
  box-shadow: none !important;
}

#calendar .fc-toolbar-chunk:last-child .fc-button-group,
#calendar .fc-button-group:has(.fc-dayGridMonth-button) {
  background: #f1f5f9 !important;
  padding: 4px !important;
  border-radius: 14px !important;
  border: 1px solid #e2e8f0 !important;
  display: inline-flex !important;
  gap: 3px !important;
}

#calendar .fc-dayGridMonth-button,
#calendar .fc-listMonth-button {
  min-height: 34px !important;
  padding: 6px 18px !important;
  border-radius: 10px !important;
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  box-shadow: none !important;
  margin: 0 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#calendar .fc-dayGridMonth-button:hover,
#calendar .fc-listMonth-button:hover {
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.6) !important;
  transform: none;
}

#calendar .fc-dayGridMonth-button.fc-button-active,
#calendar .fc-listMonth-button.fc-button-active {
  color: #4338ca !important;
  background: #ffffff !important;
  border: none !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
}

#calendar .fc-col-header {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

#calendar .fc-col-header-cell {
  background: transparent !important;
  padding: 12px 4px !important;
  border-color: #e2e8f0 !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

#calendar .fc-col-header-cell-cushion {
  color: #334155 !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  font-size: 0.88rem !important;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-block;
}

#calendar .fc-day-sat .fc-col-header-cell-cushion,
#calendar .fc-day-sun .fc-col-header-cell-cushion {
  color: #ea580c !important;
  background: rgba(234, 88, 12, 0.08);
}

#calendar .fc-daygrid-day-frame {
  min-height: 128px;
  transition: background-color 0.15s ease;
  position: relative;
}

#calendar .fc-daygrid-day:hover .fc-daygrid-day-frame {
  background-color: rgba(241, 245, 249, 0.5);
  cursor: pointer;
}

#calendar .fc-day-sat,
#calendar .fc-day-sun {
  background-color: #fafbfc !important;
}

#calendar .fc-day-sat:hover .fc-daygrid-day-frame,
#calendar .fc-day-sun:hover .fc-daygrid-day-frame {
  background-color: rgba(241, 245, 249, 0.65);
}

#calendar .fc-daygrid-day-top {
  flex-direction: row-reverse;
  padding: 4px 6px 2px;
}

#calendar .fc-daygrid-day-number {
  padding: 4px 8px !important;
  color: #475569 !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  font-size: 0.88rem !important;
  border-radius: 8px;
  transition: all 0.15s ease;
}

#calendar .fc-daygrid-day:hover .fc-daygrid-day-number {
  color: #0f172a !important;
  background: #e2e8f0;
}

#calendar .fc-day-other {
  background-color: #fcfcfd !important;
  opacity: 0.5;
}

#calendar .fc-day-other .fc-daygrid-day-number {
  color: #94a3b8 !important;
}

#calendar .fc-day-today {
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.75) 0%, rgba(255, 255, 255, 0.4) 100%) !important;
  box-shadow: inset 0 3px 0 0 #ea580c !important;
}

#calendar .fc-day-today .fc-daygrid-day-number {
  margin: 2px 4px !important;
  min-width: 32px !important;
  height: 32px !important;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%) !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.38) !important;
}

#calendar .fc-event,
#calendar .fc-daygrid-event,
#calendar .fc-daygrid-dot-event,
#calendar .fc-daygrid-block-event,
#calendar .fc-h-event {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 3px 5px !important;
  cursor: pointer !important;
  white-space: normal !important;
}

#calendar .fc-daygrid-event-dot {
  display: none !important;
}

.fc-event-main {
  padding: 7px 9px !important;
  border-radius: 11px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  width: 100% !important;
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04) !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.fc-event:hover .fc-event-main {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 18px -2px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

.fc-event:active .fc-event-main {
  transform: scale(0.98) !important;
}

.fc-event-main.status-in-use {
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%) !important;
  border: 1px solid rgba(254, 205, 211, 0.9) !important;
  border-left: 4px solid #f43f5e !important;
}

.fc-event-main.status-in-use .fc-event-time {
  color: #be123c !important;
  font-weight: 800 !important;
}

.fc-event-main.status-waiting {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%) !important;
  border: 1px solid rgba(187, 247, 208, 0.9) !important;
  border-left: 4px solid #10b981 !important;
}

.fc-event-main.status-waiting .fc-event-time {
  color: #047857 !important;
  font-weight: 800 !important;
}

.fc-event-main.status-done {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%) !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  border-left: 4px solid #94a3b8 !important;
}

.fc-event-main.status-done .fc-event-time {
  color: #64748b !important;
  font-weight: 700 !important;
}

.fc-event-main.is-owner {
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.12) !important;
  border-right: 3px solid #6366f1 !important;
}

.fc-event-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 4px !important;
}

.fc-event-time {
  font-size: 0.74rem !important;
  line-height: 1.2 !important;
}

.fc-event-badge {
  font-size: 0.67rem !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
}

.fc-event-badge.in-use {
  background: #fee2e2 !important;
  color: #9f1239 !important;
  border: 1px solid #fecdd3 !important;
}

.fc-event-badge.waiting {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}

.fc-event-badge.done {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f43f5e;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.28);
}

.status-static-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}

.status-dot-done {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}

.fc-event-title {
  font-size: 0.86rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.35 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.fc-event-footer {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin-top: 2px !important;
}

.fc-unit-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  background: #eff6ff !important;
  color: #1e40af !important;
  border: 1px solid #dbeafe !important;
  font-size: 0.71rem !important;
  font-weight: 700 !important;
  max-width: 100% !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.owner-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 4px !important;
  background: #e0e7ff !important;
  color: #4338ca !important;
  font-size: 0.65rem !important;
  flex-shrink: 0 !important;
}

.holiday-label {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  color: #dc2626 !important;
  background: #fef2f2 !important;
  border: 1px solid #fee2e2 !important;
  padding: 3px 9px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  max-width: 90% !important;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(220, 38, 38, 0.08) !important;
  z-index: 2;
}

#calendar .fc-list {
  overflow: hidden !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03) !important;
  background: #ffffff !important;
}

#calendar .fc-list-day-cushion {
  padding: 12px 18px !important;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  font-size: 0.95rem !important;
  border-bottom: 1.5px solid #e2e8f0 !important;
}

#calendar .fc-list-event td {
  padding: 14px 18px !important;
  border-color: #f1f5f9 !important;
  vertical-align: middle;
}

#calendar .fc-list-event:hover td {
  background-color: #f8fafc !important;
  cursor: pointer;
}

.fab-container {
  position: fixed;
  bottom: 36px;
  right: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 1050;
}

.fab-btn {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  cursor: pointer;
}

.fab-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}

.btn-add {
  color: white !important;
  background: linear-gradient(135deg, var(--primary), #f97316) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: var(--shadow-glow) !important;
}

.btn-add:hover {
  box-shadow: 0 14px 34px rgba(234, 88, 12, 0.45) !important;
}

.btn-dash {
  color: #059669 !important;
}

.btn-dash:hover {
  background: #f0fdf4 !important;
  color: #047857 !important;
}

.btn-chat {
  color: white !important;
  background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
  position: relative;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.3) !important;
}

.btn-chat i {
  color: white !important;
}

.chat-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 16px;
  height: 16px;
  background-color: #ef4444;
  border: 2px solid white;
  border-radius: 50%;
}

.chat-badge::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px solid rgba(239, 68, 68, 0.65);
  border-radius: 50%;
  animation: badge-ring 1.8s ease-out infinite;
  will-change: transform, opacity;
  pointer-events: none;
}

@keyframes badge-ring {
  0% { transform: scale(1); opacity: 0.8; }
  70%, 100% { transform: scale(1.8); opacity: 0; }
}

.visitor-counter {
  position: fixed;
  bottom: 36px;
  left: 36px;
  z-index: 1050;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-radius: 20px;
  padding: 10px 18px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.visitor-counter:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.visitor-counter i {
  color: var(--primary);
}

.swal2-container {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(15, 23, 42, 0.5) !important;
}

.swal-premium-popup,
.swal2-popup {
  border-radius: 26px !important;
  padding: 24px !important;
  background: #ffffff !important;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.9) inset !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  font-family: inherit !important;
}

.swal-premium-title,
.swal2-title {
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.02em !important;
  padding: 0 0 16px 0 !important;
}

.swal-premium-close,
.swal2-close {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: #f1f5f9 !important;
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  border: 1px solid #e2e8f0 !important;
  top: 16px !important;
  right: 16px !important;
}

.swal-premium-close:hover,
.swal2-close:hover {
  background: #fee2e2 !important;
  color: #ef4444 !important;
  border-color: #fca5a5 !important;
  transform: rotate(90deg) scale(1.05) !important;
}

.swal-premium-confirm,
.swal2-confirm {
  border-radius: 14px !important;
  padding: 12px 32px !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  background: #334155 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(51, 65, 85, 0.25) !important;
  transition: all 0.2s ease !important;
  border: none !important;
}

.swal-premium-confirm:hover,
.swal2-confirm:hover {
  background: #0f172a !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3) !important;
}

.swal-event-card {
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 18px 20px;
  position: relative;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.swal-dept-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #dbeafe;
}

.swal-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.swal-status-badge .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.swal-status-badge.waiting {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.swal-status-badge.waiting .status-dot {
  background: #10b981;
}

.swal-status-badge.in-use {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}
.swal-status-badge.in-use .status-dot {
  background: #f43f5e;
}

.swal-status-badge.done {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.swal-status-badge.done .status-dot {
  background: #94a3b8;
}

.swal-event-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.45;
}

.swal-action-btn {
  width: 100%;
  padding: 13px 20px;
  border-radius: 16px;
  border: none;
  font-weight: 700;
  font-size: 0.96rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.swal-action-btn.btn-view {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
}

.swal-action-btn.btn-view:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
}

.swal-action-btn.btn-edit {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.32);
}

.swal-action-btn.btn-edit:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.42);
}

.swal-action-btn.btn-locked {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  cursor: not-allowed;
  box-shadow: none;
}

.swal-detail-container {
  width: 100%;
}

.swal-detail-header {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 14px;
}

.swal-detail-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.4;
  margin: 0;
}

.swal-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.swal-detail-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 16px;
}

.swal-detail-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.swal-detail-content label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin: 0 0 2px 0;
}

.swal-detail-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.live-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 14px 22px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: all 0.3s ease;
  flex-wrap: wrap;
}

.live-status-bar.available {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.live-status-bar.in-use {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%);
}

.live-status-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-status-indicator {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.live-status-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  transition: background 0.3s ease;
}

.live-status-bar.in-use .live-status-pulse {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.live-status-info {
  display: flex;
  flex-direction: column;
}

.live-status-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.live-status-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.live-status-bar.available .live-status-value {
  color: #047857;
}

.live-status-bar.in-use .live-status-value {
  color: #b91c1c;
}

.live-status-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.live-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.84rem;
  color: #334155;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.03);
}

.live-stat-chip.clickable {
  cursor: pointer;
  background: #ffffff;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-stat-chip.clickable:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.live-stat-chip.clickable:active {
  transform: scale(0.97);
}

.live-stat-chip strong {
  font-weight: 800;
  color: #0f172a;
}

.stat-chip-label {
  color: #64748b;
  font-weight: 600;
}

.live-status-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.live-status-badge-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #9f1239;
  background: #ffe4e6;
  border: 1px solid #fecdd3;
  padding: 3px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 3px rgba(159, 18, 57, 0.06);
  transition: all 0.2s ease;
}

.live-status-badge-title:hover {
  background: #fecdd3;
  transform: translateY(-1px);
}

.live-status-badge-unit {
  font-size: 0.76rem;
  font-weight: 700;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 3px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.swal-today-popup {
  max-width: 520px !important;
}

.swal-today-list {
  padding: 2px 4px;
}

.swal-today-item {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.swal-today-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.swal-today-item.status-in-use {
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 100%);
  border-left: 4px solid #f43f5e;
  border-color: #fecdd3;
}

.swal-today-item.status-waiting {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border-left: 4px solid #10b981;
  border-color: #bbf7d0;
}

.swal-today-item.status-done {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-left: 4px solid #94a3b8;
  border-color: #e2e8f0;
}

.swal-today-time {
  font-size: 0.8rem;
  font-weight: 800;
  color: #334155;
}

.swal-today-title {
  font-size: 0.95rem;
  line-height: 1.35;
}

.modal-title-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
}

.modal-content {
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: 28px !important;
  box-shadow: 0 25px 60px -10px rgba(15, 23, 42, 0.25) !important;
  backdrop-filter: blur(20px);
}

.modal-header {
  border-bottom: 1px solid #f1f5f9 !important;
}

.booking-warning-alert {
  background: #fef2f2;
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.05);
}

.modal-footer {
  border-top: 1px solid #f1f5f9 !important;
}

.form-control,
.form-select {
  border-radius: 14px;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.time-period-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--secondary-light);
  color: var(--secondary);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
}

.time-period-badge:empty {
  visibility: hidden;
}

.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary), #f97316);
  color: white;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-btn);
  border: none;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: var(--shadow-glow);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary-custom:hover {
  background: linear-gradient(135deg, var(--primary-hover), #ea580c);
  box-shadow: 0 12px 28px rgba(234, 88, 12, 0.38);
  transform: translateY(-1px);
}

.btn-secondary-custom {
  background: #f1f5f9;
  color: var(--muted);
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-btn);
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.btn-secondary-custom:hover {
  background: #e2e8f0;
  color: var(--ink);
}

.dash-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
}

.dash-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08) !important;
  border-color: rgba(79, 70, 229, 0.3) !important;
}

.icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
}

.table-hover tbody tr:hover {
  background-color: #f8fafc;
}

.chat-window {
  position: fixed;
  bottom: 115px;
  right: 36px;
  width: 390px;
  height: 520px;
  background: var(--surface-card);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 25px 60px -10px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  z-index: 1060;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(20px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.chat-window.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.chat-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1055;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.chat-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.chat-header {
  padding: 16px 22px;
  background: linear-gradient(135deg, #1e293b, #334155);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-title {
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-header-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.95rem;
  transition: .2s;
  cursor: pointer;
}

.chat-header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
}

.chat-msg-row.msg-user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-msg-row.msg-admin {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.88rem;
  line-height: 1.45;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  word-break: break-word;
}

.msg-user .msg-bubble {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg-admin .msg-bubble {
  background: white;
  color: #1f2937;
  border-bottom-left-radius: 4px;
  border: 1px solid #e5e7eb;
}

.msg-time {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 4px;
  padding: 0 4px;
}

.msg-bubble-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.msg-user .msg-bubble-wrapper {
  flex-direction: row-reverse;
}

.msg-admin .msg-bubble-wrapper {
  flex-direction: row;
}

.msg-delete-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  font-size: 0.85rem;
  transition: color 0.2s, opacity 0.2s;
  opacity: 0;
}

.msg-bubble-wrapper:hover .msg-delete-btn {
  opacity: 1;
}

@media (max-width: 768px) {
  .msg-delete-btn {
    opacity: 0.7;
  }
}

.msg-delete-btn:hover {
  color: #ef4444;
}

.chat-user-profile-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
  color: #475569;
}

.profile-name-text strong {
  color: var(--primary);
}

.profile-edit-btn {
  background: none;
  border: none;
  color: #6366f1;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.2s;
}

.profile-edit-btn:hover {
  background: #e2e8f0;
  color: #4f46e5;
}

.chat-upload-btn {
  background: #f1f5f9;
  border: none;
  color: #64748b;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
  flex-shrink: 0;
}

.chat-upload-btn:hover {
  background: #e2e8f0;
  color: var(--primary);
  transform: scale(1.05);
}

.msg-attachment-img-container {
  border-radius: 12px;
  overflow: hidden;
  max-width: 220px;
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.1);
  margin-top: 4px;
}

.msg-attachment-img {
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.msg-attachment-name {
  font-size: 0.72rem;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.03);
  color: inherit;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.msg-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit !important;
  font-weight: 600;
  word-break: break-all;
}

.msg-attachment-link i {
  font-size: 1.1rem;
}

.chat-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  padding: 44px 20px;
}

.chat-image-lightbox.show {
  display: flex;
}

.chat-image-lightbox-img {
  max-width: min(92vw, 1100px);
  max-height: 84vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  background: #111827;
}

.chat-image-lightbox-close {
  position: fixed;
  top: 22px;
  right: 28px;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.chat-image-lightbox-close:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.85);
}

.chat-footer {
  padding: 14px 18px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 0.9rem;
  outline: none;
  transition: .2s;
  resize: none;
  max-height: 80px;
}

.chat-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), #f97316);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}

.chat-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.35);
}

.admin-threads-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.admin-thread-item {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: .2s;
  background: white;
}

.admin-thread-item:hover {
  background: #f8fafc;
}

.admin-thread-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  margin-left: 10px;
}

.admin-thread-delete-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  font-size: 0.85rem;
  transition: color 0.2s, opacity 0.2s;
  opacity: 0;
}

.admin-thread-item:hover .admin-thread-delete-btn {
  opacity: 1;
}

@media (max-width: 768px) {
  .admin-thread-delete-btn {
    opacity: 0.7;
  }
}

.admin-thread-delete-btn:hover {
  color: #ef4444;
}

.admin-thread-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.admin-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.admin-thread-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-thread-time {
  font-size: 0.72rem;
  color: #9ca3af;
}

.admin-thread-msg {
  font-size: 0.78rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-thread-badge {
  background-color: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.admin-thread-item.unread {
  background: #f0fdf4;
}

.chat-search-bar {
  padding: 10px 14px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.chat-search-input {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-search-input:focus {
  border-color: #4f46e5;
}

@media (min-width: 769px) and (max-width: 1024px) {
  body { padding: 16px 16px 110px; }
  .main-card { padding: 26px 20px; }
  #calendar { min-height: 540px; }
  .fab-container { bottom: 24px; right: 24px; gap: 12px; }
  .fab-btn { width: 56px; height: 56px; font-size: 22px; border-radius: 18px; }
  .visitor-counter { bottom: 24px; left: 24px; padding: 10px 14px; font-size: .85rem; }
  .logo-img { height: 80px; }
  #dashboardModal .col-md-3 {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

@media (max-width: 768px) {
  body {
    padding: 6px 6px calc(112px + env(safe-area-inset-bottom)) 6px !important;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .main-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 6px 4px !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .page-header {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0;
    height: auto;
    justify-content: flex-start !important;
    padding: 14px 12px !important;
    margin-bottom: 12px !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .page-header > .brand-block,
  .page-header > .header-status {
    flex: 0 0 auto;
    width: 100%;
  }

  .brand-block {
    width: 100% !important;
    min-height: 0;
    align-items: flex-start !important;
    text-align: left !important;
    gap: 10px !important;
  }

  .brand-block > .brand-copy {
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  .brand-copy {
    flex: 0 0 auto !important;
    min-height: 0;
  }

  .logo-img {
    width: auto !important;
    height: auto !important;
    max-height: 68px !important;
    max-width: 100% !important;
    object-position: left center;
  }

  .brand-copy h2 {
    font-size: clamp(1.2rem, 5vw, 1.5rem) !important;
    word-break: break-word !important;
  }

  .brand-copy #siteSubtitle,
  .brand-copy #siteWarning {
    font-size: 0.78rem !important;
  }

  .header-status {
    display: flex !important;
    justify-content: flex-end !important;
    width: 100% !important;
    gap: 8px !important;
    margin-top: 6px;
  }

  .header-status > * {
    width: auto !important;
    min-width: 0 !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .calendar-panel {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 10px !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .calendar-guidance {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 12px;
  }

  .calendar-quick-book {
    width: 100%;
  }

  #calendar {
    min-height: 640px;
    contain-intrinsic-size: 640px;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  #calendar .fc-toolbar {
    gap: 8px;
    padding-bottom: 12px;
    width: 100% !important;
  }

  #calendar .fc-toolbar-chunk {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
  }

  #calendar .fc-toolbar-chunk:nth-child(2) {
    order: -1;
    justify-content: center !important;
  }

  #calendar .fc-toolbar-title {
    font-size: 1.1rem !important;
  }

  #calendar .fc-button-primary {
    min-height: 38px;
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
  }

  #calendar .fc-scroller {
    overflow-x: hidden !important;
  }

  #calendar .fc-daygrid-day-frame {
    min-height: 84px;
  }

  #calendar .fc-daygrid-event {
    margin: 2px 3px !important;
  }

  #calendar .fc-daygrid-event .unit-badge {
    display: none;
  }

  #calendar .fc-list {
    border-radius: 14px;
    width: 100% !important;
  }

  #calendar .fc-list-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    background: transparent;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  #calendar .fc-list-day {
    display: table;
    width: 100% !important;
  }

  #calendar .fc-list-day-cushion {
    border-radius: 12px;
  }

  #calendar .fc-list-event {
    display: block;
    margin: 0 0 10px;
    overflow: hidden;
    border: 1px solid #e7ebf3;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(30, 41, 59, 0.06);
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #calendar .fc-list-event td {
    display: block;
    border: 0 !important;
  }

  #calendar .fc-list-event-title {
    width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  #calendar .fc-list-event-title .fc-event-main {
    padding: 10px !important;
  }

  #calendar .fc-list-event-title .title-text {
    font-size: 0.88rem;
    word-break: break-word !important;
  }

  #calendar .fc-list-event-title .time-text {
    font-size: 0.74rem;
  }

  .visitor-counter {
    left: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .fab-container {
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .fab-btn {
    width: 52px;
    height: 52px;
    font-size: 20px;
    border-radius: 16px;
  }

  
  .chat-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 86vh;
    border-radius: 28px 28px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-bottom: none;
    z-index: 1080;
    transform: translateY(100%) scale(1);
    opacity: 0;
  }

  
  #dashboardModal .modal-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
    padding: 16px 16px 8px !important;
  }

  #dashboardModal .modal-header > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }

  #dashboardModal .modal-header input[type="date"],
  #dashboardModal .modal-header select {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
  }

  #dashboardModal .col-md-3 {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }

  #dashboardModal .display-6 {
    font-size: 1.6rem !important;
  }

  #dashboardModal .h4 {
    font-size: 1rem !important;
  }

  #dashboardModal .col-lg-8,
  #dashboardModal .col-lg-4 {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  #dashboardModal .table {
    font-size: 0.78rem !important;
  }

  #dashboardModal .table td,
  #dashboardModal .table th {
    padding: 6px 8px !important;
  }

  #dashboardModal .modal-body {
    padding: 12px !important;
  }

  
  .modal-content {
    border-radius: 22px !important;
  }

  .form-control,
  .form-select {
    padding: 10px 14px;
    font-size: 0.92rem;
  }

  .btn-primary-custom,
  .btn-secondary-custom {
    padding: 12px;
    font-size: 0.92rem;
  }
}

@media (max-width: 400px) {
  body {
    padding: 4px 4px calc(105px + env(safe-area-inset-bottom)) 4px !important;
  }

  .page-header {
    padding: 12px 10px !important;
    border-radius: 16px !important;
  }

  .calendar-panel {
    padding: 10px 6px !important;
    border-radius: 16px !important;
  }

  .brand-copy h2 {
    font-size: 1.1rem !important;
  }

  .calendar-hint {
    font-size: 0.74rem;
  }

  #calendar .fc-toolbar-chunk:last-child .fc-button {
    padding-left: 6px !important;
    padding-right: 6px !important;
    font-size: 0.74rem !important;
  }

  .visitor-counter {
    font-size: 0.75rem;
    left: 8px;
  }

  .fab-container {
    right: 8px;
  }

  .fab-btn {
    width: 48px;
    height: 48px;
    font-size: 19px;
  }

  .lang-btn {
    padding: 6px 10px;
    font-size: 0.76rem;
  }
}

.fab-btn:focus-visible,
.lang-btn:focus-visible,
.chat-header-btn:focus-visible,
.chat-send-btn:focus-visible,
.calendar-quick-book:focus-visible {
  outline: 3px solid rgba(234, 88, 12, 0.45);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
