body {
  font-family: "Source Sans Pro", system-ui, Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100vh;
}

#reportFrame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  border: none;
}

#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5em;
  text-align: center;
  color: #333;
}

#error {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2em;
  color: #c00;
  text-align: center;
  display: none;
}

/* Auth Container and Login Screen */
.auth-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-box {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  padding: 40px;
  text-align: center;
  max-width: 400px;
}

.auth-box h1 {
  margin: 0 0 10px 0;
  font-size: 28px;
  color: #333;
}

.auth-box p {
  margin: 0 0 30px 0;
  color: #666;
  font-size: 14px;
}

.auth-info {
  font-size: 12px;
  color: #999;
  margin-top: 20px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: #667eea;
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: #5568d3;
}

.btn-logout {
  background: #f44336;
  padding: 8px 16px;
  font-size: 13px;
}

.btn-logout:hover {
  background: #d32f2f;
}

.btn-logout-full {
  width: 100%;
  margin-top: 0;
}

.btn-secondary {
  background: #667eea;
  color: white;
  padding: 10px 20px;
  margin-top: 15px;
}

.btn-secondary:hover {
  background: #5568d3;
}

/* Reports Toggle Button (Top Left) */
.reports-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  background: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: #333;
}

/* Reset Floating Action Button next to reports toggle */
.reset-changes {
  position: fixed;
  top: 20px;
  left: 76px; /* sit next to reports-toggle (48px width + 8px gap) */
  z-index: 1000;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0f7a33; /* darker green to meet contrast */
  color: #f9fafb; /* slightly off-white for better contrast */
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.reset-changes:hover {
  background: #15803d; /* darker green on hover */
}

.reset-changes[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.reports-toggle:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

.reports-toggle:active {
  transform: scale(0.95);
}

/* Reports Panel Overlay */
.reports-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.reports-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Reports Slide-Out Panel */
.reports-panel {
  position: fixed;
  top: 0;
  left: -320px;
  width: 320px;
  height: 100%;
  background: white;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 999;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
}

.reports-panel.active {
  left: 0;
}

/* Panel Header */
.reports-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.reports-panel-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.reports-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease;
  color: #666;
}

.reports-close:hover {
  background: #e0e0e0;
}

/* Panel Content */
.reports-panel-content {
  flex: 1;
  overflow-y: auto;
}

/* Reports List */
.reports-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.report-item {
  padding: 0 10px;
  padding-right: 50px; /* Space for icon */
  margin: 0; /* Remove margin for table-like appearance */
  background: white;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-height: 56px; /* Consistent height for all items */
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Animation */
  animation: slideIn 0.3s ease forwards;
  opacity: 0;
}

.report-item:first-child {
  border-top: 1px solid #e5e7eb;
}

.report-item:hover {
  background: #f3f4f6;
  border-left: 3px solid #667eea;
  padding-left: 13px; /* Compensate for border */
}

.report-item.active {
  background: #eff6ff;
  border-left: 3px solid #667eea;
  padding-left: 13px; /* Compensate for border */
}

.report-item.active .report-item-name {
  color: #667eea;
  font-weight: 700;
}

.report-item-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 2px 0;
  padding-right: 8px;
  word-wrap: break-word;
  color: #1f2937;
}

.report-item-description {
  font-size: 12px;
  line-height: 1.3;
  color: #6b7280;
  margin: 0;
  padding-right: 8px;
  word-wrap: break-word;
}

.report-item-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  transition: all 0.2s ease;
}

.report-item:hover .report-item-icon {
  color: #667eea;
  transform: translateY(-50%) translateX(2px);
}

.report-item.active .report-item-icon {
  color: #667eea;
}

/* Loading State */
.reports-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.reports-loading p {
  color: #666;
  margin: 0;
  font-size: 14px;
}

/* Error State */
.reports-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.reports-error svg {
  color: #f44336;
  margin-bottom: 16px;
}

.reports-error p {
  color: #666;
  margin: 0 0 8px 0;
  font-size: 14px;
}

/* Empty State */
.reports-empty {
  padding: 40px 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .reports-panel {
    width: 280px;
    left: -280px;
  }
  
  .reports-toggle {
    top: 12px;
    left: 12px;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .reports-panel {
    width: 100%;
    max-width: 320px;
    left: -100%;
  }
}

/* Accessibility */
.reports-toggle:focus,
.reports-close:focus,
.report-item:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Animation for panel items */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* User Toggle Button (Top Right) */
.user-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  z-index: 901;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: #333;
}

.user-toggle:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

.user-toggle:active {
  transform: scale(0.95);
}

.user-toggle.active {
  border-radius: 8px 0 0 8px;
  box-shadow: -2px 2px 12px rgba(0, 0, 0, 0.15);
}

/* User Panel Overlay */
.user-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 997;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.user-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* User Slide-Out Panel - Expandable from button */
.user-panel {
  position: fixed;
  top: 20px;
  right: 80px;
  width: 0;
  height: 48px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 998;
  transition: width 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0;
  border: none;
  overflow: hidden;
}

.user-panel.active {
  width: 280px;
  box-shadow: -2px 2px 12px rgba(0, 0, 0, 0.15);
}

/* User Panel Content - Expandable */
.user-panel-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}

/* User Profile Card - Expandable */
.user-profile-card {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  padding: 0;
  border: none;
  margin: 0;
  justify-content: center;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name-label {
  font-size: 12px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
}

.user-name {
  font-size: 14px;
  color: #1f2937;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-avatar {
  display: none;
}

.user-avatar svg {
  display: none;
}

/* Logout Button in Panel */
.btn-logout-panel {
  background: #f44336;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-logout-panel:hover {
  background: #d32f2f;
}

/* Responsive Design for User Panel */
@media (max-width: 768px) {
  .user-toggle {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
  }

  .user-panel {
    width: 0;
    height: 44px;
    top: 12px;
    right: 68px;
  }

  .user-panel.active {
    width: 240px;
  }

  .user-panel-content {
    padding: 0 12px;
    gap: 8px;
  }

  .user-name {
    font-size: 13px;
  }

  .user-name-label {
    font-size: 11px;
  }

  .btn-logout-panel {
    padding: 6px 10px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .user-panel {
    width: 0;
    height: 40px;
    top: 10px;
    right: 60px;
  }

  .user-panel.active {
    width: 200px;
  }

  .user-toggle {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .user-panel-content {
    padding: 0 10px;
    gap: 6px;
  }

  .user-name-label {
    font-size: 10px;
  }

  .user-name {
    font-size: 12px;
  }

  .btn-logout-panel {
    padding: 6px 8px;
    font-size: 10px;
  }
}

/* Accessibility */
.user-toggle:focus,
.user-close:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}
