:root {
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f6f7fb;
  color: #0f172a;
}

* {
  box-sizing: border-box;
}

body,
html {
  margin: 0;
  min-height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.app {
  max-width: 840px;
  width: 100%;
}

.card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  padding: 2.5rem 3rem;
  display: grid;
  gap: 1.75rem;
}

.card h1 {
  margin: 0;
  font-size: 2rem;
}

.project-switcher {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.project-options {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.project-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.project-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.project-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid #d8dceb;
  background: #f8f9ff;
  font-weight: 600;
  color: #0f172a;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.project-pill:hover span {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
}

.project-pill input:checked + span {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.project-pill input:focus-visible + span {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.question {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.question label {
  font-weight: 600;
}

.question input,
.question select,
.question textarea {
  border-radius: 10px;
  border: 1px solid #d5d8e1;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.question select {
  display: none;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d5d8e1;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.custom-select-button:hover {
  border-color: #a6b0c9;
}

.custom-select-button:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.custom-select-button.open {
  border-color: #2563eb;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.custom-select-arrow {
  width: 12px;
  height: 8px;
  flex-shrink: 0;
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

.custom-select-button.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #d5d8e1;
  border-top: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  display: none;
}

.custom-select-dropdown.open {
  display: block;
}

.custom-select-option {
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  cursor: pointer;
  color: #0f172a;
  transition: background 0.15s ease;
}

.custom-select-option:hover {
  background: #f8f9ff;
}

.custom-select-option.selected {
  background: #e0e7ff;
  color: #2563eb;
  font-weight: 500;
}

.custom-select-option:first-child {
  padding-top: 0.5rem;
}

.custom-select-option:last-child {
  padding-bottom: 0.5rem;
}

.question input:focus,
.question select:focus,
.question textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.question textarea {
  min-height: 80px;
  max-height: 300px;
}

/* Auto-grow textarea */
.question.textarea-field textarea {
  overflow: hidden;
  resize: none;
}

.form-grid {
  display: grid;
  gap: 1.5rem;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.type-card {
  border: 1px solid #d8dceb;
  border-radius: 18px;
  padding: 1rem 1.25rem;
  background: #f8f9ff;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border 0.15s ease;
}

.type-card span {
  font-weight: 600;
}

.type-card small {
  color: #5a6482;
  line-height: 1.4;
}

.type-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.15);
  border-color: #2563eb;
}

.type-card.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(129, 140, 248, 0.18));
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.4);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.card-header .hint {
  margin-top: 0.35rem;
}

.attachment-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-top: 1px solid #edf0f7;
  padding-top: 1.5rem;
}

.attachment-section header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.attachment-section h2 {
  margin: 0;
  font-size: 1.2rem;
}

.attachment-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.attachment-grid p.hint {
  grid-column: 1 / -1;
  margin: 0;
}

.attachment-thumb {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f9fafc;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  text-align: center;
}

.attachment-thumb img {
  max-width: 100%;
  border-radius: 12px;
  object-fit: cover;
  max-height: 180px;
}

.attachment-thumb p {
  margin: 0;
  font-size: 0.9rem;
  color: #334155;
}

.remove-attachment {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, background 0.2s ease;
}

.remove-attachment:hover {
  transform: scale(1.05);
  background: rgba(15, 23, 42, 0.9);
}

.drop-area {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  border: 2px dashed #a6b0c9;
  border-radius: 16px;
  padding: 1.25rem;
  text-align: center;
  background: rgba(37, 99, 235, 0.04);
  transition: border 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.drop-area.dragging {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
  transform: translateY(-2px);
}

.drop-area.loading {
  opacity: 0.6;
  pointer-events: none;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.3s ease;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

.btn.outline {
  background: transparent;
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.4);
  box-shadow: none;
}

.btn.outline:hover {
  background: rgba(37, 99, 235, 0.1);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.2);
}

.btn[disabled] {
  background: #a5b4fc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn.secondary {
  background: #e2e8f0;
  color: #0f172a;
  box-shadow: none;
}

.hint {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0;
}

.alert {
  padding: 1rem 1.2rem;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 12px;
  border: 1px solid #fecaca;
}

.success {
  padding: 1rem 1.2rem;
  background: #dcfce7;
  color: #166534;
  border-radius: 12px;
  border: 1px solid #bbf7d0;
}

.summary {
  display: grid;
  gap: 0.75rem;
}

.review-attachments {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.review-attachments h2 {
  margin: 0;
  font-size: 1.2rem;
}

.review-attachments ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.review-attachments li {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.review-attachments img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.summary-item {
  border: 1px solid #e2e8f0;
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.summary-item span {
  font-size: 0.875rem;
  color: #64748b;
}

.highlight-error {
  outline: 3px solid rgba(249, 115, 22, 0.65);
  outline-offset: 4px;
  transition: outline 0.2s ease;
}

.highlight-error input,
.highlight-error select,
.highlight-error textarea {
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  .card {
    padding: 1.75rem;
  }

  .card-header {
    flex-direction: column;
    align-items: stretch;
  }

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

  .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.google-buttons-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.google-button-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.domain-label {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
  margin: 0;
}

/* Form steps styling */
.form-step {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-bottom: 1px solid #edf0f7;
  padding-bottom: 1.5rem;
}

.form-step:last-of-type {
  border-bottom: none;
}

.step-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Questions container */
.questions-container {
  display: grid;
  gap: 1.2rem;
}

.questions-section {
  display: grid;
  gap: 1.2rem;
}

/* Optional section with details */
.optional-section {
  margin-top: 0.5rem;
}

.optional-section summary {
  cursor: pointer;
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
  padding: 0.75rem 0;
  transition: color 0.2s ease;
  user-select: none;
}

.optional-section summary:hover {
  color: #2563eb;
}

.optional-content {
  display: grid;
  gap: 1.2rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

/* Floating actions */
.floating-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #edf0f7;
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, rgba(255, 255, 255, 1) 90%, rgba(255, 255, 255, 0));
  z-index: 10;
}

.btn-sm {
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}

/* Attachment section less intrusive */
.attachment-section {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.attachment-section header {
  gap: 0.1rem;
}

.attachment-section h2 {
  font-size: 1rem;
  font-weight: 600;
}

.drop-area {
  padding: 1rem;
  border-width: 1px;
  border-style: dashed;
  min-height: 120px;
}

.attachment-grid {
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* Preview section */
.preview-section {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.preview-section summary {
  cursor: pointer;
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
  padding: 0.75rem 0;
  transition: color 0.2s ease;
  user-select: none;
}

.preview-section summary:hover {
  color: #2563eb;
}

.preview-content {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.inline-preview {
  display: grid;
  gap: 1rem;
}

.preview-meta {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 3px solid #2563eb;
}

.preview-meta p {
  margin: 0;
  font-size: 0.95rem;
}

.preview-meta strong {
  color: #334155;
}

.preview-answers {
  display: grid;
  gap: 0.75rem;
}

.preview-item {
  padding: 0.75rem;
  background: #f9fafc;
  border-radius: 8px;
  border-left: 2px solid #e0e7ff;
}

.preview-item strong {
  font-size: 0.9rem;
  color: #64748b;
  display: block;
  margin-bottom: 0.35rem;
}

.preview-item p {
  margin: 0;
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.5;
}

/* Help button and modal styles */
.label-with-help {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-button {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.help-button:hover {
  opacity: 1;
}

.help-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.help-modal.active {
  display: flex;
}

.help-modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.help-modal-content h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #1e293b;
  font-size: 1.5rem;
}

.help-modal-content p {
  margin: 0.75rem 0;
  color: #475569;
  line-height: 1.6;
}

.help-modal-content ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
  color: #475569;
}

.help-modal-content li {
  margin: 0.5rem 0;
  line-height: 1.6;
}

.help-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-modal-close:hover {
  color: #1e293b;
}

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

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 1.5rem;
  border-radius: 12px;
  color: white;
  text-align: center;
}

.stat-card:nth-child(2) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3) {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
}

.filter-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  font-size: 0.875rem;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-select:hover {
  border-color: #94a3b8;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.tickets-list {
  display: grid;
  gap: 1rem;
}

.ticket-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s;
  cursor: pointer;
  border-left: 3px solid #e2e8f0;
}

.ticket-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

/* Subtle card colors based on status */
.ticket-card[data-status="working"] {
  border-left-color: #3b82f6;
  background: linear-gradient(to right, rgba(59, 130, 246, 0.02), #ffffff);
}

.ticket-card[data-status="testing"] {
  border-left-color: #f59e0b;
  background: linear-gradient(to right, rgba(245, 158, 11, 0.02), #ffffff);
}

.ticket-card[data-status="completed"] {
  border-left-color: #10b981;
  background: linear-gradient(to right, rgba(16, 185, 129, 0.02), #ffffff);
}

.ticket-card[data-status="pending"] {
  border-left-color: #64748b;
  background: linear-gradient(to right, rgba(100, 116, 139, 0.02), #ffffff);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.ticket-id {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.ticket-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ticket-badge.project {
  background: #dbeafe;
  color: #1e40af;
}

.ticket-badge.status {
  background: #f1f5f9;
  color: #475569;
}

.ticket-badge.status-blue {
  background: #dbeafe;
  color: #1e40af;
}

.ticket-badge.status-orange {
  background: #fed7aa;
  color: #c2410c;
}

.ticket-badge.status-green {
  background: #bbf7d0;
  color: #15803d;
}

.ticket-badge.status-gray {
  background: #f1f5f9;
  color: #64748b;
}

.ticket-badge.status-purple {
  background: #e9d5ff;
  color: #7c3aed;
}

.ticket-badge.type {
  background: #fef3c7;
  color: #92400e;
}

.ticket-badge.priority {
  background: #fce7f3;
  color: #9f1239;
}

.planning-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.planning-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 0.875rem;
}

.planning-info.no-planning {
  justify-content: flex-start;
}

.planning-sprint {
  font-weight: 600;
  color: #475569;
}

.planning-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
}

.planning-status.status-blue {
  background: #dbeafe;
  color: #1e40af;
}

.planning-status.status-orange {
  background: #fed7aa;
  color: #c2410c;
}

.planning-status.status-green {
  background: #bbf7d0;
  color: #15803d;
}

.planning-status.status-gray {
  background: #f1f5f9;
  color: #64748b;
}

.planning-status.status-purple {
  background: #e9d5ff;
  color: #7c3aed;
}

.ticket-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.ticket-date {
  font-size: 0.875rem;
  color: #64748b;
}

.ticket-link {
  font-size: 0.875rem;
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.ticket-link:hover {
  color: #764ba2;
}

.ticket-more-btn {
  font-size: 0.875rem;
  color: #667eea;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
  transition: color 0.2s;
  text-decoration: none;
  display: inline-block;
}

.ticket-more-btn:hover {
  color: #764ba2;
}

.ticket-description {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 0.75rem;
}

.ticket-description p {
  margin: 0;
  font-size: 0.925rem;
  color: #475569;
  line-height: 1.5;
}

.ticket-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 0.75rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 0.925rem;
  color: #1e293b;
  font-weight: 500;
}

.ticket-title-section {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex: 1;
}

.ticket-title-section .ticket-title {
  flex: 1;
}

.ticket-dates {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
}

.loading-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
}

.loading-state p {
  margin: 0;
  font-size: 1rem;
}

/* Email Tags Component */
.email-tags-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.email-tags-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
  color: #0f172a;
  font-size: 0.95rem;
  margin: 0;
  padding: 0;
}

.email-tags-label small {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 400;
}

.email-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #f9fafb;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 48px;
  align-items: center;
  align-content: flex-start;
}

.email-tags-container:focus-within {
  border-color: #2563eb;
  background: #f0f7ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.email-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideIn 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.email-tag-text {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: break-all;
}

.email-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: background 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.email-tag-remove:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.email-tag-remove:active {
  transform: scale(0.95);
}

.email-tags-input {
  flex: 1;
  min-width: 120px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-family: inherit;
  color: #0f172a;
  outline: none;
}

.email-tags-input::placeholder {
  color: #94a3b8;
}

.email-tags-count {
  font-size: 0.8rem;
  color: #64748b;
  display: inline-block;
  margin-top: 0.25rem;
}

/* Responsive adjustments for dashboard */
@media (max-width: 640px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-filters {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .ticket-header {
    flex-direction: column;
  }

  .ticket-footer {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .email-tag-text {
    max-width: 80px;
  }

  .email-tags-input {
    min-width: 80px;
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease-in-out;
}

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

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  background: white;
}

.modal-title-section {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex: 1;
}

.modal-title-section h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #1e293b;
  flex: 1;
}

.modal-ticket-id {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.modal-body {
  padding: 1.5rem;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.modal-section {
  margin-bottom: 1.5rem;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section-title {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-description {
  margin: 0;
  font-size: 1rem;
  color: #475569;
  line-height: 1.7;
  word-break: break-word;
  overflow-wrap: break-word;
  background-color: #f8fafc;
  padding: 1.25rem;
  border-radius: 6px;
  border-left: 3px solid #667eea;
}

.modal-description p {
  margin: 0.75rem 0;
  line-height: 1.7;
}

.modal-description p:first-child {
  margin-top: 0;
}

.modal-description p:last-child {
  margin-bottom: 0;
}

.modal-description strong,
.modal-description b {
  font-weight: 700;
  color: #1e293b;
}

.modal-description em,
.modal-description i {
  font-style: italic;
  color: #475569;
}

.modal-description u {
  text-decoration: underline;
}

.modal-description br {
  display: block;
  content: "";
  margin: 0.5rem 0;
}

.modal-description ul,
.modal-description ol {
  margin: 0.75rem 0;
  padding-left: 2rem;
}

.modal-description ul li,
.modal-description ol li {
  margin: 0.5rem 0;
  line-height: 1.7;
}

.modal-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.modal-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-detail-value {
  font-size: 0.95rem;
  color: #1e293b;
  font-weight: 500;
}

.modal-dates {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-date-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background-color: #f8fafc;
  border-radius: 6px;
}

.modal-date-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.modal-date-value {
  font-size: 0.875rem;
  color: #1e293b;
  font-weight: 600;
}

.modal-footer-link {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}

.modal-tp-link {
  font-size: 0.8rem;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
  display: inline-block;
}

.modal-tp-link:hover {
  color: #667eea;
  text-decoration: underline;
}

.modal-footer-text {
  margin: 0.5rem 0 0 0;
  font-size: 0.75rem;
  color: #cbd5e1;
  font-weight: 400;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
  }

  .modal-title-section {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-title-section h2 {
    font-size: 1.25rem;
  }

  .modal-details-grid {
    grid-template-columns: 1fr;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
  }
}
