/* Reset and Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--gray-900);
  background-color: var(--gray-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 0;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--gray-700);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--primary);
}

/* Main Content */
main {
  flex: 1;
  padding: 2rem 0;
}

h1 {
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.subtitle {
  color: var(--gray-500);
  margin-bottom: 2rem;
}

/* Forms */
.form-container, .login-container {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Badges */
.app-badge, .type-badge, .status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.app-badge {
  background: var(--gray-100);
  color: var(--gray-700);
}

.type-badge {
  background: var(--gray-200);
  color: var(--gray-700);
}

.type-badge.type-bug-report {
  background: #fef2f2;
  color: #991b1b;
}

.type-badge.type-feature-request {
  background: #eff6ff;
  color: #1e40af;
}

.type-badge.type-general-feedback {
  background: #f0fdf4;
  color: #166534;
}

.status-badge {
  background: var(--gray-200);
  color: var(--gray-700);
}

.status-badge.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.status-in-progress {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.status-done {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.status-won-t-do {
  background: #f3f4f6;
  color: #6b7280;
}

/* Feature Cards */
.feature-list {
  display: grid;
  gap: 1rem;
}

.feature-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.feature-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.feature-description {
  color: var(--gray-700);
  margin-bottom: 1rem;
}

.feature-footer {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* Tables */
.feedback-table-container {
  overflow-x: auto;
}

.feedback-table {
  width: 100%;
  background: white;
  border-radius: 8px;
  border-collapse: collapse;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.feedback-table th,
.feedback-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.feedback-table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
}

.description-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Detail View */
.feedback-detail {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.detail-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.detail-content {
  margin-bottom: 2rem;
}

.detail-content h3,
.detail-contact h3,
.status-update h3 {
  font-size: 1rem;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.description {
  white-space: pre-wrap;
  background: var(--gray-50);
  padding: 1rem;
  border-radius: 6px;
}

.status-form {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.status-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
}

.detail-timestamps {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-500);
  font-size: 0.875rem;
}

.detail-contact {
  margin-bottom: 2rem;
}

.status-update {
  margin-bottom: 2rem;
}

/* Utility */
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--gray-500);
  text-decoration: none;
}

.back-link:hover {
  color: var(--primary);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--gray-500);
}

.error-page {
  text-align: center;
  padding: 3rem;
}

.error-message {
  font-size: 1.25rem;
  color: var(--gray-700);
  margin-bottom: 2rem;
}

.error-stack {
  text-align: left;
  background: var(--gray-100);
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 2rem;
  overflow-x: auto;
}

/* Footer */
.footer {
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 1rem 0;
  margin-top: auto;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    gap: 1rem;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .status-form {
    flex-direction: column;
    align-items: stretch;
  }
}
