/* Side Panel — Shared sliding panel component */

/* ===== OVERLAY ===== */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Body scroll lock */
body.panel-open {
  overflow: hidden;
}

/* ===== PANEL CONTAINER ===== */
.panel-container {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(75vw, 920px);
  min-width: 500px;
  background: #ffffff;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
}

.panel-overlay.open .panel-container {
  transform: translateX(0);
}

/* ===== HEADER ===== */
.panel-header {
  flex-shrink: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 0;
  gap: 12px;
}

.panel-title-left {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.panel-title-text {
  min-width: 0;
}

.panel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
  font-family: monospace;
}

.panel-subtitle .status-badge {
  font-family: "Inter", -apple-system, sans-serif;
}

.panel-title-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ===== BACK BUTTON ===== */
.panel-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  margin-top: 2px;
  transition: all 0.15s;
}

.panel-back-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* ===== CLOSE BUTTON ===== */
.panel-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}

.panel-close-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

/* ===== ACTIONS DROPDOWN ===== */
.panel-actions-wrap {
  position: relative;
}

.panel-actions-btn {
  background: none;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  color: #64748b;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}

.panel-actions-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.panel-actions-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 220px;
  z-index: 1010;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
}

.panel-actions-menu.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.panel-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  text-align: left;
  font-family: inherit;
  transition: background 0.1s;
}

.panel-action-item:first-child {
  border-radius: 8px 8px 0 0;
}

.panel-action-item:last-child {
  border-radius: 0 0 8px 8px;
}

.panel-action-item:only-child {
  border-radius: 8px;
}

.panel-action-item:hover {
  background: #f1f5f9;
}

.panel-action-item .material-icons {
  font-size: 18px;
  color: #64748b;
}

.panel-action-item.danger {
  color: #dc2626;
}

.panel-action-item.danger .material-icons {
  color: #dc2626;
}

.panel-action-item.danger:hover {
  background: #fef2f2;
}

/* ===== TABS ===== */
.panel-tabs {
  display: flex;
  gap: 0;
  padding: 12px 24px 0;
}

.panel-tab {
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.panel-tab:hover {
  color: #1e293b;
}

.panel-tab.active {
  color: #2b6cb0;
  border-bottom-color: #2b6cb0;
  font-weight: 600;
}

/* ===== BODY ===== */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ===== LOADING ===== */
.panel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
}

.panel-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: #2b6cb0;
  border-radius: 50%;
  animation: panelSpin 0.6s linear infinite;
}

@keyframes panelSpin {
  to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .panel-container {
    width: 100vw;
    min-width: unset;
  }

  .panel-title-row {
    padding: 16px 16px 0;
  }

  .panel-tabs {
    padding: 12px 16px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .panel-tab {
    flex-shrink: 0;
    padding: 10px 12px;
    font-size: 13px;
  }

  .panel-body {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .panel-title {
    font-size: 17px;
  }

  .panel-actions-menu {
    min-width: 180px;
  }
}

/* ===== PROFILE PANEL THEME (blue gradient — matches Reservations panel) ===== */

#side-panel-container.profile-panel-theme .panel-header {
  background: linear-gradient(90deg, #0b3b67 0%, #1198ef 100%);
  border-bottom: none;
}

#side-panel-container.profile-panel-theme .panel-title-row {
  padding: 22px 22px 10px;
}

#side-panel-container.profile-panel-theme .panel-title {
  color: #ffffff;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

#side-panel-container.profile-panel-theme .panel-subtitle {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.95);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: 14px;
}

#side-panel-container.profile-panel-theme .panel-actions-btn,
#side-panel-container.profile-panel-theme .panel-close-btn {
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
}

#side-panel-container.profile-panel-theme .panel-actions-btn:hover,
#side-panel-container.profile-panel-theme .panel-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

#side-panel-container.profile-panel-theme .panel-back-btn {
  color: rgba(255, 255, 255, 0.9);
}

#side-panel-container.profile-panel-theme .panel-back-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

#side-panel-container.profile-panel-theme .panel-tabs {
  padding: 0 22px 0;
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

#side-panel-container.profile-panel-theme .panel-tab {
  color: rgba(255, 255, 255, 0.96);
  border-bottom-color: transparent;
  font-weight: 600;
  padding: 11px 15px;
}

#side-panel-container.profile-panel-theme .panel-tab.active {
  color: #0b3152;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 3px 3px 0 0;
  border-bottom-color: transparent;
}

#side-panel-container.profile-panel-theme .panel-body {
  padding-top: 16px;
}

/* Profile panel subtitle badges */
.profile-panel-contact {
  color: rgba(255, 255, 255, 0.9);
}

.profile-panel-badges {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.profile-panel-badges .profile-badge {
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.profile-panel-badges .profile-badge-rewards {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.profile-panel-badges .profile-badge-agent {
  background: rgba(219, 234, 254, 0.25);
  color: #bfdbfe;
}

.profile-panel-badges .profile-badge-staff {
  background: rgba(209, 250, 229, 0.25);
  color: #a7f3d0;
}

.profile-panel-badges .profile-badge-b2b {
  background: rgba(254, 243, 199, 0.25);
  color: #fde68a;
}
