/* ==========================================================================
   PUBLIC SCHEDULE VIEWER - CALENDAR-FIRST ARCHITECTURE (public-view.css)
   Interactive Calendar Engine: Month Grid & Weekly Time-Grid (06:00 - 23:00)
   Apple Calendar / Linear AMOLED Aesthetic & Glassmorphism
   ========================================================================== */

:root {
  --pv-bg-app: #f8fafc;
  --pv-bg-card: #ffffff;
  --pv-bg-card-subtle: #f1f5f9;
  --pv-bg-secondary: #f1f5f9;
  --pv-border: #e2e8f0;
  --pv-border-light: rgba(226, 232, 240, 0.7);
  --pv-text-main: #0f172a;
  --pv-text-secondary: #64748b;
  --pv-text-muted: #64748b;
  --pv-primary: #2563eb;
  --pv-primary-hover: #1d4ed8;
  --pv-primary-subtle: #dbeafe;
  --pv-success: #16a34a;
  --pv-success-subtle: #dcfce7;
  --pv-warning: #d97706;
  --pv-warning-subtle: #fef3c7;
  --pv-danger: #dc2626;
  --pv-danger-subtle: #fee2e2;
  --pv-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --pv-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --pv-shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.08);
  --pv-radius: 12px;
  --pv-radius-sm: 8px;
  --pv-hour-height: 52px; /* 1 giờ = 52px trong Weekly Time Grid */
}

[data-theme="dark"] {
  --pv-bg-app: #090d16;
  --pv-bg-card: #111827;
  --pv-bg-card-subtle: #172136;
  --pv-bg-secondary: #1e293b;
  --pv-border: #233047;
  --pv-border-light: rgba(35, 48, 71, 0.6);
  --pv-text-main: #f8fafc;
  --pv-text-secondary: #94a3b8;
  --pv-text-muted: #94a3b8;
  --pv-primary: #3b82f6;
  --pv-primary-hover: #60a5fa;
  --pv-primary-subtle: rgba(59, 130, 246, 0.16);
  --pv-success: #22c55e;
  --pv-success-subtle: rgba(34, 197, 94, 0.16);
  --pv-warning: #f59e0b;
  --pv-warning-subtle: rgba(245, 158, 11, 0.16);
  --pv-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --pv-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --pv-shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.45);

  /* Bootstrap 5 Dark Overrides */
  --bs-body-color: #f8fafc;
  --bs-body-bg: #090d16;
  --bs-emphasis-color: #ffffff;
  --bs-secondary-color: #94a3b8;
  --bs-tertiary-color: #64748b;
  --bs-border-color: #233047;
}

.pv-staff-name {
  color: var(--pv-text-main) !important;
  font-weight: 700;
}

[data-theme="dark"] .text-body,
[data-theme="dark"] .pv-staff-name,
[data-theme="dark"] .pv-block-title,
[data-theme="dark"] .pv-mobile-card-title,
[data-theme="dark"] .pv-drawer-header h3 {
  color: #f8fafc !important;
}

[data-theme="dark"] .text-muted,
[data-theme="dark"] .pv-drawer-shift-time,
[data-theme="dark"] .pv-block-staff,
[data-theme="dark"] .pv-mobile-card-subinfo {
  color: #94a3b8 !important;
}

[data-theme="dark"] .bg-card {
  background-color: var(--pv-bg-card) !important;
  color: var(--pv-text-main) !important;
}

/* Base HTML & Body */
html {
  overflow-x: hidden;
  max-width: 100vw;
}

body.public-viewer-body {
  background-color: var(--pv-bg-app);
  color: var(--pv-text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.pv-header {
  background-color: var(--pv-bg-card);
  border-bottom: 1px solid var(--pv-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--pv-shadow-sm);
  backdrop-filter: blur(8px);
}

.pv-header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pv-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--pv-text-main);
}

.pv-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--pv-radius-sm);
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.pv-brand-info h1 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.pv-brand-info p {
  font-size: 0.75rem;
  color: var(--pv-text-muted);
  margin: 0;
}

/* Calendar Date Navigator */
.pv-cal-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--pv-bg-card-subtle);
  border: 1px solid var(--pv-border);
  padding: 0.25rem 0.4rem;
  border-radius: var(--pv-radius-sm);
}

.pv-cal-nav-btn {
  background: none;
  border: none;
  color: var(--pv-text-main);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pv-cal-nav-btn:hover {
  background-color: var(--pv-border);
}

.pv-cal-nav-title {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0 0.5rem;
  white-space: nowrap;
}

/* Nút Hôm Nay Hiện Đại */
.pv-cal-today-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.32rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  background-color: var(--pv-bg-card);
  border: 1px solid var(--pv-border);
  color: var(--pv-text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  white-space: nowrap;
  margin-left: 2px;
}

.pv-cal-today-btn:hover {
  background-color: rgba(37, 99, 235, 0.08);
  border-color: var(--pv-primary);
  color: var(--pv-primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15);
}

.pv-cal-today-btn:active {
  transform: scale(0.96);
}

.pv-today-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--pv-primary);
  display: inline-block;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.6);
}

/* Header Action Buttons */
.pv-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pv-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--pv-radius-sm);
  border: 1px solid var(--pv-border);
  background-color: var(--pv-bg-card);
  color: var(--pv-text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pv-icon-btn:hover {
  background-color: var(--pv-bg-card-subtle);
  border-color: var(--pv-primary);
  color: var(--pv-primary);
}

/* Auth Button (Đăng Nhập / Quản Trị) */
.pv-btn-auth {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--pv-radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pv-btn-auth-login {
  background-color: var(--pv-primary);
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.pv-btn-auth-login:hover {
  background-color: var(--pv-primary-hover);
  color: #ffffff;
}

.pv-btn-auth-admin {
  background-color: var(--pv-bg-card-subtle);
  color: var(--pv-primary) !important;
  border: 1px solid var(--pv-primary);
}

/* ==========================================================================
   TOOLBAR & FILTERS
   ========================================================================== */
.pv-toolbar {
  background-color: var(--pv-bg-card);
  border-bottom: 1px solid var(--pv-border);
  padding: 0.65rem 1rem;
}

.pv-toolbar-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.pv-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pv-filter-wrap {
  display: flex;
  align-items: center;
  position: relative;
}

.pv-filter-icon {
  position: absolute;
  left: 12px;
  z-index: 2;
  font-size: 0.85rem;
  pointer-events: none;
}

.pv-select {
  padding: 0.45rem 1.8rem 0.45rem 0.75rem;
  border-radius: var(--pv-radius-sm);
  border: 1px solid var(--pv-border);
  background-color: var(--pv-bg-app);
  color: var(--pv-text-main);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  height: 38px;
  transition: border-color 0.15s ease;
}

.pv-filter-wrap .pv-select {
  padding-left: 32px;
}

@media (min-width: 769px) {
  .pv-filter-wrap:nth-child(1) .pv-select {
    width: 230px;
  }
  .pv-filter-wrap:nth-child(2) .pv-select {
    width: 180px;
  }
}

.pv-select:focus {
  border-color: var(--pv-primary);
}

/* Add to Phone Calendar Button */
.pv-btn-ical {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--pv-radius-sm);
  background-color: var(--pv-success-subtle);
  color: var(--pv-success);
  border: 1px solid var(--pv-success);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pv-btn-ical:hover {
  background-color: var(--pv-success);
  color: #ffffff;
}

/* View Switcher Tabs */
.pv-view-switcher {
  display: flex;
  background-color: var(--pv-bg-app);
  border: 1px solid var(--pv-border);
  border-radius: var(--pv-radius-sm);
  padding: 2px;
}

.pv-view-tab {
  background: none;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--pv-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pv-view-tab:hover {
  color: var(--pv-text-main);
}

.pv-view-tab.active {
  background-color: var(--pv-bg-card);
  color: var(--pv-primary);
  box-shadow: var(--pv-shadow-sm);
}

/* ==========================================================================
   MAIN WORKSPACE
   ========================================================================== */
.pv-main {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
}

/* Loading & Empty States */
.pv-state-box {
  text-align: center;
  padding: 3.5rem 1rem;
  background-color: var(--pv-bg-card);
  border-radius: var(--pv-radius);
  border: 1px solid var(--pv-border);
  box-shadow: var(--pv-shadow-sm);
}

.pv-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--pv-border);
  border-top-color: var(--pv-primary);
  border-radius: 50%;
  animation: pv-spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes pv-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   CHẾ ĐỘ 1: LỊCH THÁNG (MONTH CALENDAR GRID)
   ========================================================================== */
.pv-month-container {
  background-color: var(--pv-bg-card);
  border: 1px solid var(--pv-border);
  border-radius: var(--pv-radius);
  box-shadow: var(--pv-shadow-sm);
  position: relative;
}

.pv-month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: var(--pv-bg-card-subtle);
  border-bottom: 1px solid var(--pv-border);
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--pv-text-muted);
  padding: 0.65rem 0;
  position: sticky;
  top: 57px;
  z-index: 30;
  border-top-left-radius: var(--pv-radius);
  border-top-right-radius: var(--pv-radius);
  backdrop-filter: blur(8px);
}

.pv-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: var(--pv-border-light);
  gap: 1px;
}

.pv-month-day {
  background-color: var(--pv-bg-card);
  min-height: 110px;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  transition: background-color 0.15s ease;
  cursor: pointer;
  position: relative;
}

.pv-month-day:hover {
  background-color: var(--pv-bg-card-subtle);
}

.pv-month-day.other-month {
  opacity: 0.38;
  background-color: var(--pv-bg-app);
}

.pv-month-day.is-today {
  background-color: rgba(59, 130, 246, 0.04);
}

.pv-month-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.pv-month-day-num {
  font-weight: 700;
  font-size: 0.875rem;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.pv-month-day.is-today .pv-month-day-num {
  background-color: var(--pv-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.pv-month-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

/* Event Pill inside Month Cell */
.pv-month-event-pill {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.725rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid var(--pv-primary);
  background-color: var(--pv-bg-card-subtle);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pv-month-more-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--pv-primary);
  margin-top: 2px;
}

/* ==========================================================================
   CHẾ ĐỘ 2: LỊCH TUẦN THEO TRỤC THỜI GIAN (WEEKLY TIME-GRID)
   Google Calendar / Deputy / 7shifts Style (06:00 - 23:00)
   ========================================================================== */
.pv-timegrid-wrap {
  background-color: var(--pv-bg-card);
  border: 1px solid var(--pv-border);
  border-radius: var(--pv-radius);
  overflow: auto;
  box-shadow: var(--pv-shadow-sm);
  max-height: calc(100vh - 210px);
}

.pv-timegrid-table {
  min-width: 1050px;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Time Grid Header Row */
.pv-timegrid-header {
  display: flex;
  background-color: var(--pv-bg-card-subtle);
  border-bottom: 2px solid var(--pv-border);
  position: sticky;
  top: 0;
  z-index: 25;
}

.pv-time-axis-header {
  width: 60px;
  min-width: 60px;
  border-right: 1px solid var(--pv-border);
  padding: 0.65rem 0.25rem;
  text-align: center;
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--pv-text-muted);
}

.pv-timegrid-days-header {
  display: flex;
  flex: 1;
}

.pv-timegrid-day-col-header {
  flex: 1;
  min-width: 140px;
  padding: 0.65rem 0.25rem;
  text-align: center;
  border-right: 1px solid var(--pv-border);
}

.pv-timegrid-day-col-header:last-child {
  border-right: none;
}

.pv-timegrid-day-col-header.is-today {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12) 0%, rgba(37, 99, 235, 0.04) 100%);
  border-bottom: 3px solid var(--pv-primary);
}

.pv-timegrid-day-col-header .day-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--pv-text-muted);
}

.pv-timegrid-day-col-header.is-today .day-label {
  color: var(--pv-primary);
  font-weight: 800;
}

.pv-timegrid-day-col-header .day-date {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
  transition: all 0.15s ease;
}

.pv-timegrid-day-col-header.is-today .day-date {
  background-color: var(--pv-primary);
  color: #ffffff !important;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* Time Grid Body */
.pv-timegrid-body {
  display: flex;
  position: relative;
  height: calc(var(--pv-hour-height) * 18); /* 06:00 đến 24:00 (18 tiếng) */
}

/* Left Time Axis Column */
.pv-time-axis-col {
  width: 60px;
  min-width: 60px;
  border-right: 1px solid var(--pv-border);
  background-color: var(--pv-bg-card-subtle);
  position: relative;
  user-select: none;
}

.pv-time-axis-slot {
  height: var(--pv-hour-height);
  border-bottom: 1px solid var(--pv-border-light);
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--pv-text-muted);
  text-align: center;
  box-sizing: border-box;
  padding-top: 2px;
}

/* Columns for 7 Days */
.pv-timegrid-cols {
  display: flex;
  flex: 1;
  position: relative;
}

.pv-timegrid-col {
  flex: 1;
  min-width: 140px;
  border-right: 1px solid var(--pv-border-light);
  position: relative;
  height: 100%;
}

.pv-timegrid-col:last-child {
  border-right: none;
}

.pv-timegrid-col.is-today {
  background-color: rgba(37, 99, 235, 0.045);
}

[data-theme="dark"] .pv-timegrid-col.is-today {
  background-color: rgba(59, 130, 246, 0.08);
}

/* Hour Grid Lines Background */
.pv-timegrid-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-bottom: 1px solid var(--pv-border-light);
  pointer-events: none;
}

/* Event Blocks (Khối ca làm theo tỷ lệ thời gian - Redesigned Card) */
.pv-time-block {
  position: absolute;
  left: var(--block-left, 3px);
  width: var(--block-width, calc(100% - 6px));
  border-radius: 8px;
  background-color: var(--pv-bg-card);
  border: 1px solid var(--pv-border);
  cursor: pointer;
  z-index: 10;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease;
  display: flex;
  box-sizing: border-box;
}

.pv-time-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  z-index: 20;
  border-color: var(--accent-color, var(--pv-primary)) !important;
}

[data-theme="light"] .pv-time-block {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .pv-time-block {
  background: #1e293b;
  border-color: rgba(59, 130, 246, 0.25);
}

/* Left Accent Color Strip */
.pv-block-accent {
  width: 3.5px;
  min-width: 3.5px;
  height: 100%;
  background-color: var(--pv-primary);
  flex-shrink: 0;
}

/* Card Body */
.pv-block-body {
  flex: 1;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.02) 0%, rgba(37, 99, 235, 0.005) 100%);
}

/* Tier 1: Header (Time & Capacity Pill) */
.pv-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}

.pv-block-time {
  font-size: 0.68rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--pv-primary);
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv-shift-pill {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 12px;
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--pv-primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.2;
}

/* Tier 2: Title / Shift Name */
.pv-block-title {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 2px;
  color: var(--pv-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pv-block-staff {
  font-size: 0.7rem;
  font-weight: 500;
  margin-top: 2px;
  color: var(--pv-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tier 3: Avatar Stack */
.pv-avatar-stack {
  display: flex;
  align-items: center;
  margin-top: auto;
  padding-top: 2px;
  overflow: hidden;
  max-width: 100%;
}

.pv-avatar-stack-item {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--pv-primary);
  border: 1.5px solid var(--pv-bg-card);
  margin-left: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.pv-avatar-stack-item:first-child {
  margin-left: 0;
}

.pv-avatar-stack-more {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--pv-text-muted);
  margin-left: 3px;
  flex-shrink: 0;
}

/* Khi khối hẹp (chia cột con): ẩn avatar để giữ chữ thông thoáng */
.pv-time-block.is-narrow .pv-avatar-stack {
  display: none !important;
}

.pv-time-block.is-narrow .pv-block-title {
  font-size: 0.72rem;
}

/* Current Time Horizontal Line (Vạch đỏ thời gian thực) */
.pv-current-time-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #ef4444;
  z-index: 20;
  pointer-events: none;
}

.pv-current-time-dot {
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
  animation: pv-pulse-dot 1.5s infinite;
}

@keyframes pv-pulse-dot {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* ==========================================================================
   DAY DETAIL DRAWER / MODAL
   ========================================================================== */
.pv-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.pv-drawer-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.pv-drawer {
  background-color: var(--pv-bg-card);
  border-radius: var(--pv-radius);
  border: 1px solid var(--pv-border);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--pv-shadow-lg);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.pv-drawer-backdrop.show .pv-drawer {
  transform: scale(1);
}

.pv-drawer-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--pv-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--pv-bg-card-subtle);
}

.pv-drawer-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.pv-drawer-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pv-drawer-shift-card {
  padding: 0.75rem 1rem;
  background-color: var(--pv-bg-card-subtle);
  border-radius: var(--pv-radius-sm);
  border: 1px solid var(--pv-border);
  border-left: 4px solid var(--pv-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pv-drawer-shift-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--pv-shadow-sm);
}

.pv-drawer-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--pv-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.pv-drawer-shift-badge,
.pv-shift-solid-badge {
  font-size: 0.825rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  display: inline-block;
  letter-spacing: 0.2px;
  background-color: var(--pv-primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.pv-drawer-shift-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--pv-text-muted);
}

.pv-month-time-tag {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background-color: var(--pv-primary);
  color: #ffffff;
  display: inline-block;
  flex-shrink: 0;
}

/* Modal Backdrop & Popup */
.pv-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pv-modal-backdrop.show {
  display: flex !important;
}

.pv-modal {
  background-color: var(--pv-bg-card);
  border-radius: var(--pv-radius);
  border: 1px solid var(--pv-border);
  max-width: 460px;
  width: 100%;
  box-shadow: var(--pv-shadow-lg);
  overflow: hidden;
}

.pv-modal-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--pv-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--pv-bg-card-subtle);
}

.pv-modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.pv-modal-close {
  background: none;
  border: none;
  color: var(--pv-text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pv-modal-close:hover {
  color: var(--pv-text-main);
  background-color: var(--pv-border);
}

.pv-modal-close i {
  pointer-events: none;
}

.pv-modal-body {
  padding: 1.25rem;
}

.pv-qr-wrap {
  display: inline-flex;
  padding: 12px;
  background: #ffffff;
  border-radius: var(--pv-radius-sm);
  border: 1px solid var(--pv-border);
  margin-bottom: 1rem;
  box-shadow: var(--pv-shadow-sm);
}

.pv-qr-wrap canvas,
.pv-qr-wrap img {
  display: block;
  max-width: 100%;
}

.pv-copy-input-wrap {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.pv-copy-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: var(--pv-radius-sm);
  border: 1px solid var(--pv-border);
  background-color: var(--pv-bg-app);
  color: var(--pv-text-main);
  font-size: 0.825rem;
}

.pv-btn-copy {
  padding: 0.5rem 1rem;
  border-radius: var(--pv-radius-sm);
  background-color: var(--pv-primary);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pv-btn-copy:hover {
  background-color: var(--pv-primary-hover);
}

/* Toast */
.pv-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #0f172a;
  color: #ffffff;
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--pv-shadow-lg);
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pv-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer */
.pv-footer {
  margin-top: auto;
  border-top: 1px solid var(--pv-border);
  background-color: var(--pv-bg-card);
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--pv-text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  /* 1. Header Layout */
  .pv-header-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.75rem;
  }

  /* Hàng 1: Brand bên trái */
  .pv-brand {
    order: 1;
    display: flex;
    align-items: center;
    gap: 0.45rem;
  }

  .pv-brand-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  .pv-brand-info h1 {
    font-size: 0.95rem;
    line-height: 1.1;
  }

  .pv-brand-info p {
    font-size: 0.68rem;
  }

  /* Hàng 1: Actions bên phải */
  .pv-header-actions {
    order: 2;
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .pv-icon-btn {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .pv-btn-auth {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
  }

  /* Hàng 2: Navigation chuyển tuần dàn đều 100% */
  .pv-cal-nav {
    order: 3;
    width: 100%;
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.45rem;
  }

  .pv-cal-nav-title {
    font-size: 0.82rem;
    padding: 0 0.25rem;
    text-align: center;
    flex: 1;
  }

  .pv-cal-today-btn {
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
  }

  /* 2. Toolbar & 2 bộ lọc full-width 100% xếp dọc */
  .pv-toolbar {
    padding: 0.5rem 0.75rem;
  }

  .pv-toolbar-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .pv-toolbar-left {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    width: 100%;
  }

  .pv-filter-wrap {
    width: 100%;
  }

  .pv-filter-wrap .pv-select {
    width: 100% !important;
    height: 38px;
    font-size: 0.84rem;
  }

  /* Ẩn tab "Lịch Tháng" trên Mobile theo quyết định grill-me */
  .pv-view-switcher {
    width: 100%;
    display: flex;
  }

  .pv-view-tab[data-view="month"] {
    display: none !important;
  }

  .pv-view-tab {
    flex: 1;
    justify-content: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.82rem;
  }

  .pv-month-day {
    min-height: 75px;
    padding: 2px;
  }
  .pv-month-day-num {
    font-size: 0.75rem;
    width: 22px;
    height: 22px;
  }
  .pv-month-event-pill {
    font-size: 0.65rem;
    padding: 1px 3px;
  }
}

/* ==========================================================================
   DEMO SITE NOTICE MODAL & BANNER (Site Demo Warning)
   ========================================================================== */
.demo-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: demoFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-modal-container {
  position: relative;
  max-width: 500px;
  width: 100%;
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(226, 232, 240, 0.9);
  overflow: hidden;
  animation: demoScaleUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .demo-modal-container {
  background: #1e293b;
  border-color: rgba(51, 65, 85, 0.9);
  color: #f1f5f9;
}

.demo-modal-glow {
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #6366f1);
}

.demo-icon-float {
  animation: demoFloat 3.5s ease-in-out infinite;
  display: inline-block;
}

.demo-floating-badge {
  animation: demoBadgePulse 2s ease-in-out infinite;
}

.demo-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: #fef3c7;
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .demo-badge-pill {
  background: #78350f;
  color: #fef3c7;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: demoPulse 1.8s infinite;
}

.demo-sub-copy {
  color: #1e293b;
}

.demo-warning-callout {
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.demo-warning-desc {
  color: #991b1b;
}

.demo-footer-note {
  color: #64748b;
}

[data-theme="dark"] .demo-sub-copy {
  color: #f8fafc !important;
}

[data-theme="dark"] .demo-warning-callout {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

[data-theme="dark"] .demo-warning-desc {
  color: #fecdd3 !important;
}

[data-theme="dark"] .demo-footer-note {
  color: #cbd5e1 !important;
}

.btn-go-official {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff !important;
  text-decoration: none;
  box-shadow: 0 8px 16px -4px rgba(37, 99, 235, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-go-official:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -4px rgba(37, 99, 235, 0.5);
  color: #ffffff !important;
}

.btn-stay-demo {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: color 0.15s ease;
  cursor: pointer;
}

.btn-stay-demo:hover {
  color: #0f172a;
  text-decoration: underline;
}

[data-theme="dark"] .btn-stay-demo {
  color: #94a3b8;
}

[data-theme="dark"] .btn-stay-demo:hover {
  color: #f1f5f9;
}

/* Sticky top banner when user dismisses modal to test demo */
.demo-top-sticky-banner {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 9999;
  background: linear-gradient(90deg, #fffbeb, #fef3c7);
  border-bottom: 1px solid #fde68a;
  padding: 0.35rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: #92400e;
}

[data-theme="dark"] .demo-top-sticky-banner {
  background: linear-gradient(90deg, #1e293b, #172136) !important;
  border-bottom: 1px solid #334155 !important;
  color: #fde68a !important;
}

[data-theme="dark"] .demo-banner-text {
  color: #e2e8f0 !important;
}

.demo-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.demo-banner-badge {
  background: #f59e0b;
  color: #ffffff;
  padding: 0.1rem 0.45rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
}

.demo-banner-btn {
  background: #2563eb;
  color: #ffffff !important;
  text-decoration: none;
  padding: 0.15rem 0.65rem;
  border-radius: 0.35rem;
  font-weight: 600;
  font-size: 0.75rem;
  transition: background 0.15s ease;
}

.demo-banner-btn:hover {
  background: #1d4ed8;
}

.demo-overlay-closing {
  animation: demoFadeOut 0.25s forwards ease-in;
}

@keyframes demoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes demoFadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}

@keyframes demoScaleUp {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes demoFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}

@keyframes demoBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes demoPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* ==========================================================================
   MOBILE-FIRST SCHEDULE VIEW (DATE STRIP & VERTICAL SHIFT CARDS)
   ========================================================================== */
.pv-mobile-schedule-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0.25rem;
}

/* Date Strip 7 Ngày */
.pv-mobile-date-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  background: var(--pv-bg-card);
  padding: 0.6rem 0.4rem;
  border-radius: 1rem;
  border: 1px solid var(--pv-border);
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
  user-select: none;
}

.pv-mobile-date-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.2rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 64px;
  position: relative;
  background: transparent;
  border: 1.5px solid transparent;
}

.pv-mobile-date-cell:active {
  transform: scale(0.94);
}

.pv-mobile-date-cell .pv-mobile-date-dow {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--pv-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.pv-mobile-date-cell .pv-mobile-date-num {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--pv-text-main);
  line-height: 1;
}

.pv-mobile-date-cell .pv-mobile-date-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 6px;
  margin-top: 0.3rem;
}

.pv-mobile-date-cell .pv-mobile-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--pv-primary);
  transition: background-color 0.2s ease;
}

/* Cell hôm nay */
.pv-mobile-date-cell.is-today:not(.is-active) {
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.05);
}

.pv-mobile-date-cell.is-today:not(.is-active) .pv-mobile-date-num {
  color: var(--pv-primary);
}

/* Cell được chọn (Active) */
.pv-mobile-date-cell.is-active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.45);
  border-color: #2563eb;
  transform: translateY(-1px);
}

.pv-mobile-date-cell.is-active .pv-mobile-date-dow,
.pv-mobile-date-cell.is-active .pv-mobile-date-num {
  color: #ffffff !important;
}

.pv-mobile-date-cell.is-active .pv-mobile-dot {
  background-color: #ffffff;
}

/* Tiêu đề Ngày được chọn */
.pv-mobile-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.4rem;
}

.pv-mobile-day-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--pv-text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pv-mobile-day-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pv-mobile-badge-today {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--pv-primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
  text-transform: uppercase;
}

.pv-mobile-badge-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: var(--pv-bg-secondary);
  color: var(--pv-text-secondary);
  border: 1px solid var(--pv-border);
}

/* Danh sách Shift Cards */
.pv-mobile-shifts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Thẻ Ca Làm Việc (Shift Card) */
.pv-mobile-shift-card {
  position: relative;
  background: var(--pv-bg-card);
  border: 1px solid var(--pv-border);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 3px 10px -2px rgba(15, 23, 42, 0.05);
  display: flex;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.pv-mobile-shift-card:active {
  transform: scale(0.985);
}

.pv-mobile-shift-card .pv-mobile-card-accent {
  width: 5px;
  background-color: var(--card-accent, #2563eb);
  flex-shrink: 0;
}

.pv-mobile-shift-card .pv-mobile-card-body {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow: hidden;
}

.pv-mobile-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.pv-mobile-card-time {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--card-accent, #2563eb);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  min-width: 0;
}

.pv-mobile-card-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.pv-mobile-badge-duration {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--pv-bg-secondary);
  color: var(--pv-text-secondary);
  border: 1px solid var(--pv-border);
  white-space: nowrap;
}

.pv-mobile-badge-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  white-space: nowrap;
}

.pv-mobile-badge-status.is-now {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
  animation: demoBadgePulse 2s infinite ease-in-out;
}

.pv-mobile-badge-status.is-upcoming {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.pv-mobile-badge-status.is-past {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.pv-mobile-card-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--pv-text-main);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pv-mobile-card-subinfo {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--pv-text-secondary);
}

.pv-mobile-card-subinfo span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.pv-mobile-card-coworkers {
  margin-top: 0.25rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--pv-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--pv-text-secondary);
}

.pv-mobile-coworkers-text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
}

.pv-mobile-coworkers-text span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

.pv-mobile-avatar-stack {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.pv-mobile-avatar-chip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--pv-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  border: 2px solid var(--pv-bg-card);
  margin-left: -6px;
}

.pv-mobile-avatar-chip:first-child {
  margin-left: 0;
}

.pv-mobile-avatar-chip.more {
  background: var(--pv-bg-secondary);
  color: var(--pv-text-secondary);
  border-color: var(--pv-border);
}

/* Empty State (Ngày nghỉ ngơi) */
.pv-mobile-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.25rem;
  background: var(--pv-bg-card);
  border: 1px dashed var(--pv-border);
  border-radius: 1.25rem;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.03);
}

.pv-mobile-empty-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 0.85rem;
}

[data-theme="dark"] .pv-mobile-empty-icon {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
}

.pv-mobile-empty-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--pv-text-main);
  margin-bottom: 0.35rem;
}

.pv-mobile-empty-desc {
  font-size: 0.82rem;
  color: var(--pv-text-secondary);
  max-width: 280px;
  line-height: 1.45;
}

/* Sticky Bottom Action Bar */
.pv-mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--pv-border);
  padding: 0.65rem 1rem max(0.65rem, env(safe-area-inset-bottom, 12px));
  display: none;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .pv-mobile-bottom-bar {
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
}

.pv-mobile-btn-ical {
  flex: 1;
  height: 46px;
  border-radius: 0.75rem;
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
}

.pv-mobile-btn-ical:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.pv-mobile-btn-qr {
  width: 46px;
  height: 46px;
  border-radius: 0.75rem;
  border: 1px solid var(--pv-border);
  background: var(--pv-bg-secondary);
  color: var(--pv-text-main);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.pv-mobile-btn-qr:active {
  transform: scale(0.95);
  background: var(--pv-border);
}

/* Responsive Trigger */
@media (max-width: 768px) {
  .pv-mobile-bottom-bar {
    display: flex;
  }
  
  /* Đảm bảo nội dung không bị che khuất bởi bottom bar */
  .pv-main {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 12px)) !important;
  }
  
  /* Ẩn bớt nút iCal trên toolbar trên mobile vì đã có ở sticky bottom */
  .pv-toolbar #btnAddToCalendar {
    display: none !important;
  }
}

/* ==========================================================================
   CALENDAR REMINDER CUSTOMIZATION MODAL & MOBILE BOTTOM SHEET
   ========================================================================== */
.pv-reminder-modal {
  max-width: 440px;
  width: 100%;
  border-radius: 1.25rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.pv-bottom-sheet-handle {
  width: 42px;
  height: 4px;
  background-color: var(--pv-border);
  border-radius: 9999px;
  margin: 10px auto 4px auto;
}

.pv-reminder-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.95rem;
  border-radius: 0.875rem;
  border: 1.5px solid var(--pv-border);
  background: var(--pv-bg-card);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  margin-bottom: 0;
}

.pv-reminder-card:hover {
  border-color: var(--pv-primary);
  background-color: var(--pv-bg-card-subtle);
}

.pv-reminder-card.active {
  border-color: var(--pv-primary);
  background-color: rgba(37, 99, 235, 0.05);
  box-shadow: 0 2px 8px -2px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .pv-reminder-card.active {
  background-color: rgba(37, 99, 235, 0.15);
  border-color: #3b82f6;
}

.pv-reminder-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--pv-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pv-reminder-info {
  flex: 1;
  min-width: 0;
}

.pv-reminder-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--pv-text-main);
  line-height: 1.25;
}

.pv-reminder-desc {
  font-size: 0.74rem;
  color: var(--pv-text-secondary);
  margin-top: 2px;
  line-height: 1.35;
}

.pv-reminder-check {
  font-size: 1.15rem;
  color: var(--pv-border);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.pv-reminder-card.active .pv-reminder-check {
  color: var(--pv-primary);
}

[data-theme="dark"] .pv-reminder-card.active .pv-reminder-check {
  color: #3b82f6;
}

/* Mobile Bottom Sheet Animation & Styling */
@media (max-width: 767.98px) {
  .pv-bottom-sheet-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .pv-bottom-sheet-backdrop.show .pv-reminder-modal {
    animation: pvBottomSheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .pv-reminder-modal {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 1.35rem 1.35rem 0 0 !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 16px));
  }

  @keyframes pvBottomSheetSlideUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }
}

