* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

header {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
}

header h1 {
  color: #0f172a;
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: 600;
}

.stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-card {
  background: #fff;
  padding: 20px 28px;
  border-radius: 10px;
  min-width: 160px;
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card:nth-child(1) {
  border-left: 4px solid #f59e0b;
}

.stat-card:nth-child(2) {
  border-left: 4px solid #3b82f6;
}

.stat-card:nth-child(3) {
  border-left: 4px solid #10b981;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  margin-top: 6px;
  color: #0f172a;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tab {
  padding: 12px 24px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s;
}

.tab:hover {
  background: #f8fafc;
  color: #0f172a;
}

.tab.active {
  background: #0f172a;
  color: white;
  border-color: #0f172a;
}

.tab-content {
  display: none;
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
}

.tab-content.active {
  display: block;
}

.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.filters select {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  cursor: pointer;
}

.filters select:focus {
  outline: none;
  border-color: #3b82f6;
}

.filters button {
  padding: 10px 20px;
  background: #0f172a;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.filters button:hover {
  background: #1e293b;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

tr:hover {
  background: #f8fafc;
}

.loading {
  text-align: center;
  color: #94a3b8;
  padding: 48px !important;
}

.status {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status.open, .status.pending {
  background: #fef3c7;
  color: #92400e;
}

.status.in_progress {
  background: #dbeafe;
  color: #1e40af;
}

.status.resolved, .status.confirmed {
  background: #d1fae5;
  color: #065f46;
}

.status.rejected {
  background: #fee2e2;
  color: #991b1b;
}

.btn-action {
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
  transition: all 0.2s;
}

.btn-edit {
  background: #f1f5f9;
  color: #475569;
}

.btn-edit:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-view {
  background: #dbeafe;
  color: #1e40af;
}

.btn-view:hover {
  background: #bfdbfe;
}

.no-screenshot {
  color: #94a3b8;
  font-size: 12px;
  font-style: italic;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 32px;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.modal-content h2 {
  margin-bottom: 24px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 600;
}

.close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 24px;
  cursor: pointer;
  color: #94a3b8;
  transition: color 0.2s;
}

.close:hover {
  color: #0f172a;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: #0f172a;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #1e293b;
}

/* Image Modal */
.image-modal-content {
  background: white;
  padding: 16px;
  border-radius: 16px;
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.image-modal-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  display: block;
}

.image-modal-content .close {
  top: 8px;
  right: 16px;
  background: rgba(255,255,255,0.9);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

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

/* Ticket details in modal */
.ticket-details {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.ticket-details.hidden {
  display: none;
}

.detail-row {
  display: flex;
  margin-bottom: 8px;
  font-size: 14px;
}

.detail-label {
  color: #64748b;
  width: 60px;
  flex-shrink: 0;
}

.detail-row span:last-child {
  color: #0f172a;
  font-weight: 500;
}

.issue-display {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  color: #1e293b;
  line-height: 1.5;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 768px) {
  .stats {
    flex-direction: column;
  }

  .stat-card {
    min-width: 100%;
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 10px 8px;
  }

  .modal-content {
    margin: 16px;
    padding: 24px;
  }
}
