/* Generale */
:root {
  --primary: #E75B89;
  --primary-h: #c5416c;
  --secondary: #F1B54D;
  --secondary-h: #c68f2f;
  --text: #1e293b;
  --text-light: #666;
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.05);
  --shadow-hover: rgba(0, 0, 0, 0.08);
  --success: #16a34a;
  --error: #dc2626;
  --warning: #ea580c;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

p {
  margin-bottom: 0.875rem;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 1rem;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.375rem;
}

h3 {
  font-size: 1.125rem;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Form segnalazione */
.logo-redux img {
  display: block;
}

.logo-redux {
  max-width: 140px;
}

.logo {
  margin: 0 auto;
  width: 100%;
  max-width: 180px;
}

.form-title {
  text-align: center;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.intro {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 0.9375rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

#form-container {
  background: var(--white);
  padding: 2rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px var(--shadow);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

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

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  color: var(--text);
  font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="file"],
.form-group select,
.form-group textarea,
.form-group input[type="password"] {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
  color: var(--text);
  background: var(--white);
}

.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(37, 99, 235, 0.1);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%231e293b' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-light);
  font-size: 0.8125rem;
}

.checkbox-group {
  margin-top: 1.5rem;
}

.form-group .privacy-checkbox {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.5;
}

.privacy-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 0.625rem;
  margin-top: 1px;
  cursor: pointer;
  accent-color: var(--primary);
}

.privacy-checkbox a {
  color: var(--primary);
  font-weight: 500;
  margin-left: 4px;
}

.privacy-checkbox a:hover {
  text-decoration: underline;
}

/* Uniforma dimensioni bottoni */
.btn-submit,
.btn-filter,
.btn-reset,
.btn-export,
.btn-search,
.btn-view,
.btn-forward {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
  border: none;
  white-space: nowrap;
}

.btn-submit {
  width: 100%;
  background: var(--primary);
  color: var(--white);
}

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

.btn-submit:active {
  background: #1e40af;
}

.btn-submit:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.error-message {
  background: #fef2f2;
  color: var(--error);
  padding: 0.875rem 1rem;
  border-radius: 4px;
  border-left: 3px solid var(--error);
  margin-top: 1rem;
  font-size: 0.875rem;
}

#success-container {
  background: var(--white);
  padding: 2rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px var(--shadow);
  border: 1px solid var(--border);
}

.success-box {
  text-align: center;
}

.success-box h2 {
  color: var(--success);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.success-box p {
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-light);
}

.tracking-code {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg);
  padding: 1rem 1.5rem;
  border-radius: 4px;
  margin: 2rem 0 1.5rem;
  letter-spacing: 3px;
  font-family: 'Courier New', monospace;
  border: 2px solid var(--border);
  cursor: copy;
  transition: all 0.2s ease;
  user-select: all;
  position: relative;
}

.tracking-code::before {
  content: '📋 Clicca per copiare';
  position: absolute;
  top: -1.75rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: normal;
  color: var(--text-light);
  font-weight: 500;
  white-space: nowrap;
}

.tracking-code:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  transform: scale(1.02);
}

.tracking-code:hover::before {
  color: var(--primary);
  font-weight: 600;
}

.tracking-code:active {
  transform: scale(0.98);
}

.success-box .btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  margin-top: 1rem;
  padding: 0 1.5rem;
  background: var(--primary);
  color: var(--white);
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
}

.success-box .btn:hover {
  background: #1d4ed8;
}

.status-title {
  text-align: center;
}

.check-status {
  text-align: center;
  margin-top: 20px;
}

.check-status a {
  color: var(--primary);
  transition: all .3s ease-in-out;
}

.check-status a:hover {
  color: var(--primary-h);
}

#copyMessage {
  margin: 0.5rem 0;
  padding: 0.5rem 1rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 4px;
  color: var(--success);
  font-weight: 600;
  font-size: 0.875rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Status badges */
.status-badge {
  display: inline-block;
  border-radius: 3px;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.3px;
}

.status-nuovo {
  color: #1e40af;
}

.status-in_analisi {
  color: #92400e;
}

.status-inoltrato {
  color: #a8219b;
}

.status-chiuso {
  color: #065f46;
}

/* Risk badges */
.risk-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.risk-basso {
  color: #065f46;
}

.risk-medio {
  color: #c8a61d;
}

.risk-alto {
  color: #c54444;
}

.risk-critico {
  color: #b90303;
}

/* Login Admin */
.login-container {
  max-width: 400px;
  margin: 6rem auto;
  background: var(--white);
  padding: 2rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px var(--shadow);
  border: 1px solid var(--border);
}

.login-container h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: var(--text);
}

/* Dashboard */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 2rem;
  border-bottom: 2px solid var(--border);
}

.admin-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.admin-actions span {
  font-size: 0.875rem;
  color: var(--text-light);
  font-weight: 500;
}

.btn-logout,
.btn-back {
  height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
  border: none;
  cursor: pointer;
  line-height: 1.1;
  text-align: center;
}

.btn-logout {
  background: #475569;
  color: var(--white);
}

.btn-logout:hover {
  background: #b91c1c;
  color: #fff;
}

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

.btn-back:hover {
  background: var(--secondary-h);
  color: #fff;
}

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

.stat-card {
  background: var(--white);
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px var(--shadow);
  text-align: center;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}

.stat-card h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.375rem;
  font-weight: 700;
}

.stat-card p {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin: 0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.search-export-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.search-export-wrap > div {
  width: 50%;
}

.filters,
.reports-section,
.export-section,
.search-section {
  background: var(--white);
  padding: 1.25rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px var(--shadow);
  border: 1px solid var(--border);
}

.filters {
  margin-bottom: 1.5rem;
}

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

.filters h2,
.reports-section h2,
.search-section h2,
.export-section h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
  font-weight: 600;
}

/* Search + Export su stessa riga */
.search-export-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.search-export-wrapper .search-section,
.search-export-wrapper .export-section {
  margin-bottom: 0;
}

.filter-form,
.export-form {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 180px;
}

.filter-group label,
.export-form label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}

.filter-group select,
.export-form select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
  background: var(--white);
  height: 38px;
}

.filter-group select:focus,
.export-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

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

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

.btn-reset:hover {
  background: var(--secondary-h);
  color: #fff;
}

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

.btn-export:hover {
  background: #15803d;
}

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

.reports-table thead {
  background: var(--bg);
}

.reports-table th {
  padding: 0.75rem 0.875rem;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.reports-table td {
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.reports-table tbody tr {
  transition: background 0.15s ease;
}

.reports-table tbody tr:hover {
  background: var(--bg);
}

.btn-view {
  color: var(--primary);
  transition: all .3s ease-in-out;
}

.btn-view:hover {
  color: var(--primary-h);
}

/* Report detail */
.report-detail {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.report-main {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.report-info-card {
  width: 40%;
}

.report-content-card {
  width: 60%;
}

.report-info-card,
.report-content-card,
.report-attachment-card,
.report-actions-card,
.report-notes-card,
.forward-report-card {
  background: var(--white);
  padding: 1.25rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px var(--shadow);
  border: 1px solid var(--border);
}

.report-info-card h2,
.report-content-card h2,
.report-attachment-card h2,
.report-actions-card h2,
.report-notes-card h2,
.forward-report-card h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text);
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.info-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row strong {
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.875rem;
}

.tracking-code-display {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1.5px;
}

.report-content {
  background: var(--bg);
  padding: 1rem;
  border-radius: 4px;
  line-height: 1.6;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
}

.wrap-form {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1.5rem;
}

.wrap-form form {
  width: 100%;
}

/* Azioni report su 2 colonne */
.report-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.report-actions-grid .action-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-form {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Note su 2 colonne */
.notes-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.note-form-column,
.notes-list-column {
  display: flex;
  flex-direction: column;
}

.note-form-column h3,
.notes-list-column h3 {
  font-size: 0.9375rem;
  margin-bottom: 0.875rem;
  color: var(--text);
  font-weight: 600;
}

.note-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  flex: 1;
}

.note-form .form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.note-form .form-group textarea {
  flex: 1;
  min-height: 150px;
}

.notes-list {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.notes-list::-webkit-scrollbar {
  width: 6px;
}

.notes-list::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 3px;
}

.notes-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.notes-list::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

.note-item {
  background: var(--bg);
  border-left: 3px solid var(--primary);
  padding: 0.875rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  transition: box-shadow 0.2s ease;
}

.note-item:hover {
  box-shadow: 0 2px 8px var(--shadow);
}

.note-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
}

.note-header strong {
  color: var(--primary);
  font-weight: 600;
}

.note-date {
  color: var(--text-light);
  font-size: 0.75rem;
}

.note-content {
  color: var(--text);
  line-height: 1.5;
  font-size: 0.875rem;
}

.wrap-notes {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1.5rem;
}

.wrap-notes form {
  width: 60%;
}

.wrap-notes .notes-list {
  width: 40%;
}

/* Forward section */
.forwarded-history {
  background: #f0f9ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.forwarded-history h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #1e40af;
  font-size: 0.9375rem;
  font-weight: 600;
}

.forward-item {
  background: var(--white);
  border-left: 3px solid #3b82f6;
  padding: 0.875rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  box-shadow: 0 1px 2px var(--shadow);
}

.forward-item:last-child {
  margin-bottom: 0;
}

.forward-date {
  color: var(--text-light);
  font-size: 0.8125rem;
  white-space: nowrap;
  display: block;
  margin-bottom: 1rem;
}

.forward-item div {
  margin-bottom: 0.2rem;
}

/* Forward form più largo e strutturato */
.forward-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.forward-form-grid .form-group {
  margin-bottom: 0;
}

.forward-form-grid .form-group:nth-child(1) {
  grid-column: 1;
}

.forward-form-grid .form-group:nth-child(2) {
  grid-column: 2;
}

.forward-form-grid .form-group:nth-child(3) {
  grid-column: 1 / -1;
}

.forward-form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-forward {
  background: #3b82f6;
  color: var(--white);
}

.btn-forward:hover {
  background: #2563eb;
}

.warning-text {
  margin: 1rem 0 0;
  padding: 0.625rem;
  font-size: 0.8125rem;
  color: var(--warning);
  background: #fff7ed;
  border-radius: 4px;
  text-align: center;
  border: 1px solid #fed7aa;
}

/* Export single */
.export-single-section {
  margin: 1.5rem 0;
  text-align: center;
  background: var(--bg);
  border-radius: 4px;
}

.export-pdf-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 1.5rem;
  background: var(--error);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.export-pdf-btn:hover {
  background: #b91c1c;
}

/* Alert messages */
.alert {
  padding: 0.875rem 1rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.875rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--error);
  border-left: 3px solid var(--error);
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--success);
  border-left: 3px solid var(--success);
}

/* Indicatori (note + allegati) */
.indicator-icon {
  position: relative;
  display: inline-block;
  margin-left: 0.375rem;
  font-size: 0.875rem;
  cursor: help;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.indicator-icon:hover {
  opacity: 1;
}

/* Tooltip per indicatori */
.indicator-icon::after {
  content: attr(title);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: var(--white);
  padding: 0.375rem 0.625rem;
  border-radius: 3px;
  font-size: 0.6875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
  font-weight: 500;
}

.indicator-icon::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1e293b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
}

.indicator-icon:hover::after,
.indicator-icon:hover::before {
  opacity: 1;
}

/* Colori specifici */
.note-indicator {
  color: var(--primary);
}

.attachment-indicator {
  color: var(--secondary);
}

.attachment-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.attachment-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.attachment-item h3 {
  font-size: 0.9375rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.text-muted {
  color: var(--text-light);
  font-style: italic;
}

/* Gestione allegati multipli */
#attachments-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.attachment-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.attachment-input {
  flex: 1;
}

.btn-add-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--main);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0.5rem;
}

.btn-add-file:hover {
  background: var(--main);
  color: var(--white);
  border-color: var(--main);
}

.btn-add-file:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg);
  color: var(--text-light);
}

.btn-remove-file {
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--error);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.btn-remove-file:hover {
  background: #b91c1c;
}

#files-preview {
  background: var(--bg);
  padding: 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text);
  display: none;
}

#files-preview.active {
  display: block;
}

#files-preview ul {
  margin: 0.25rem 0 0 0;
  padding-left: 1.25rem;
}

#files-preview li {
  margin-bottom: 0.25rem;
}

#files-preview strong {
  color: var(--main);
}

/* Search Section */
.search-form {
  display: flex;
  gap: 0;
}

.search-group {
  display: flex;
  width: 100%;
}

.search-group input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 4px 0 0 4px;
  letter-spacing: 0.5px;
  transition: border-color 0.2s ease;
  font-weight: 500;
}

.search-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-search {
  background: var(--primary);
  color: var(--white);
  border-radius: 0 4px 4px 0;
}

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

/* Search Results */
.search-results-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.search-results-info p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text);
}

.search-results-info strong {
  color: var(--primary);
  font-weight: 600;
}

/* Attachment preview */
.attachment-preview {
  margin-top: 1rem;
}

.attachment-preview img,
.attachment-preview embed {
  border-radius: 4px;
  border: 1px solid var(--border);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 1rem;
  margin-top: 1rem;
  background: var(--primary);
  color: var(--white);
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
}

.btn-download:hover {
  background: #1d4ed8;
}

/* Responsive */
@media (max-width: 768px) {

  body {
    font-size: 14px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1rem;
  }

  .container {
    padding: 0 1rem;
  }

  #form-container, #success-container,
  .login-container {
    padding: 1.5rem 1rem;
  }

  .logo-redux {
    margin: 0;
    max-width: 120px;
  }

  .tracking-code {
    font-size: 1.25rem;
    padding: 0.875rem 1rem;
    letter-spacing: 2px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .search-export-wrapper {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .filter-form, .export-form {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    min-width: auto;
  }

  .reports-table {
    font-size: 0.75rem;
  }

  .reports-table th,
  .reports-table td {
    padding: 0.5rem 0.375rem;
  }

  .wrap-form {
    flex-direction: column;
  }

  .wrap-notes {
    flex-direction: column;
  }

  .wrap-notes form, .wrap-notes .notes-list {
    width: 100%;
  }

  .admin-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .info-row {
    grid-template-columns: 1fr;
    gap: 0.375rem;
  }

  .report-main {
    flex-direction: column;
  }

  .report-info-card, .report-content-card {
    width: 100%;
  }

  .report-info-card,
  .report-content-card,
  .report-attachment-card,
  .report-actions-card,
  .report-notes-card,
  .forward-report-card {
    padding: 1rem;
  }

  .report-actions-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .notes-wrapper {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .notes-list {
    max-height: 300px;
  }

  .search-export-wrap {
    flex-direction: column;
  }

  .search-export-wrap > div {
    width: 100%;
  }

  .forward-form-grid {
    grid-template-columns: 1fr;
  }

  .forward-form-grid .form-group:nth-child(1),
  .forward-form-grid .form-group:nth-child(2) {
    grid-column: 1;
  }

  .search-group {
    width: 100%;
  }

  .search-group input {
    font-size: 0.8125rem;
  }

  .search-group input::placeholder {
    font-size: 11px;
  }

  .wrap-table {
    overflow: scroll;
  }

}