// Overlay
.panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1049;
  animation: fadeIn 0.2s ease;
}

// Slide-over panel
.report-detail-panel {
  position: fixed;
  top: 0;
  right: -1400px;
  width: 1400px;
  height: 100vh;
  background: #f8fafc;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  &.visible {
    right: 0;
  }

  @media (max-width: 1440px) {
    width: 80vw;
    right: -80vw;
  }

  @media (max-width: 768px) {
    width: 100%;
    right: -100%;
  }
}

// Header
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: white;
  border-bottom: 1px solid #e6e7e9;
  flex-shrink: 0;

  .panel-pretitle {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin-bottom: 0.25rem;
  }

  .panel-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
  }

  .panel-close-btn {
    border: none;
    background: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #6c757d;
    border-radius: 6px;
    transition: all 0.15s ease;

    &:hover {
      background: #f1f5f9;
      color: #1e293b;
    }

    .icon {
      width: 20px;
      height: 20px;
    }
  }
}

// Body
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

// Loading
.panel-loading {
  text-align: center;
  padding: 3rem 1rem;

  .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #206bc4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
  }

  p {
    color: #6c757d;
    margin: 0;
  }
}

// Error
.panel-error {
  padding: 1rem;

  .alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
  }
}

// Cards
.card {
  border: 1px solid #e6e7e9;
  border-radius: 8px;
  background: white;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

  .card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e6e7e9;
    background: #fafbfc;
    border-radius: 8px 8px 0 0;

    .card-title {
      font-size: 1rem;
      font-weight: 600;
      color: #1e293b;
      margin: 0;
    }
  }

  .card-body {
    padding: 1.25rem;
  }
}

// Stats
.stats-row {
  display: flex;
  text-align: center;
  gap: 1rem;

  .stat-item {
    flex: 1;

    .stat-label {
      font-size: 0.8rem;
      font-weight: 500;
      color: #6c757d;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .stat-value {
      font-size: 1.5rem;
      font-weight: 700;
      color: #1e293b;
      margin-top: 0.25rem;
    }

    .stat-value-sm {
      font-size: 1.125rem;
      font-weight: 600;
      color: #1e293b;
      margin-top: 0.25rem;
    }
  }
}

// Progress bars
.progress {
  height: 0.5rem;
  background-color: #e9ecef;
  border-radius: 0.25rem;
  overflow: hidden;

  &.progress-sm {
    height: 0.375rem;
  }

  .progress-bar {
    height: 100%;
    transition: width 0.3s ease;

    &.bg-green { background-color: #28a745; }
    &.bg-yellow { background-color: #ffc107; }
    &.bg-red { background-color: #dc3545; }
  }
}

// Status dots
.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;

  &.bg-red { background-color: #dc3545; }
  &.bg-yellow { background-color: #ffc107; }
  &.bg-green { background-color: #28a745; }

  &.status-dot-animated {
    animation: pulse-dot 1.5s infinite;
  }
}

// Badges
.badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;

  &.bg-red { background-color: #dc3545; color: white; }
  &.bg-yellow { background-color: #ffc107; color: #212529; }
  &.bg-green { background-color: #28a745; color: white; }
  &.bg-blue { background-color: #206bc4; color: white; }
}

// List group
.list-group-flush {
  .list-group-item {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    padding: 0.875rem 1.25rem;

    &:last-child {
      border-bottom: none;
    }
  }
}

// Alert row
.alert-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  .alert-content {
    flex: 1;
    font-size: 0.875rem;
  }
}

// Account row
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.account-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6c757d;
}

// Table
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;

  th {
    background: #fafbfc;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e6e7e9;
    white-space: nowrap;
  }

  td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
  }

  tr:hover td {
    background: #f8fafc;
  }
}

.table-footer {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.8125rem;
}

.generated-info {
  font-size: 0.8rem;
  margin-top: 1rem;
}

// Footer
.panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: white;
  border-top: 1px solid #e6e7e9;
  flex-shrink: 0;

  .footer-actions {
    display: flex;
    gap: 0.5rem;
  }
}

// Buttons
.btn {
  font-weight: 500;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;

  &.btn-primary {
    background-color: #206bc4;
    color: white;
    &:hover { background-color: #1c5ba0; }
  }

  &.btn-outline-primary {
    color: #206bc4;
    border: 1px solid #206bc4;
    background: transparent;
    &:hover { background-color: #206bc4; color: white; }
  }

  &.btn-outline-secondary {
    color: #6c757d;
    border: 1px solid #d1d5db;
    background: transparent;
    &:hover { background-color: #6c757d; color: white; }
  }

  &.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
}

// Text utilities
.text-green { color: #28a745 !important; }
.text-red { color: #dc3545 !important; }
.text-muted { color: #6c757d !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }

// Animations
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
