/* =========================
   BASE LAYOUT
========================= */

.helpdesk-container {
  max-width: var(--container, 1100px);
  margin: 72px auto;
  padding: 0 60px;
}

.helpdesk-container h2 {
  margin-bottom: 12px;
  text-align: center;
  color: var(--navy, #1d2b4f);
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -.03em;
}

.helpdesk-container > .section-sub {
  text-align: center;
  color: var(--muted, #6b7a99);
  font-size: .97rem;
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.75;
}


/* =========================
   CARD GENERICA
========================= */

.card {
  background: var(--white, #ffffff);
  border: 1px solid var(--border, #e8ecf4);
  border-radius: var(--radius-lg, 18px);
  padding: 28px;
  box-shadow: var(--shadow-sm, 0 4px 20px rgba(22,34,64,.06));
}


/* =========================
   FORM
========================= */

.helpdesk-form {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
}

.helpdesk-form label {
  margin-bottom: 6px;
  font-weight: 600;
  font-size: .875rem;
  color: var(--navy, #1d2b4f);
}

.helpdesk-form input,
.helpdesk-form textarea,
.helpdesk-form select {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border, #e8ecf4);
  border-radius: var(--radius-md, 12px);
  font-size: .9rem;
  font-family: inherit;
  background: var(--bg, #f5f7fc);
  color: var(--navy, #1d2b4f);
  transition: border-color .2s, box-shadow .2s;
}

.helpdesk-form input:focus,
.helpdesk-form textarea:focus,
.helpdesk-form select:focus {
  outline: none;
  border-color: var(--blue, #2253a0);
  box-shadow: 0 0 0 3px rgba(34,83,160,.1);
  background: #fff;
}

.helpdesk-form textarea {
  height: 150px;
  resize: vertical;
}

.helpdesk-form button {
  background: var(--navy, #1d2b4f);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-pill, 50px);
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  transition: background .2s, transform .15s;
}

.helpdesk-form button:hover {
  background: var(--blue, #2253a0);
  transform: translateY(-1px);
}


/* =========================
   THREAD (MESSAGGI)
========================= */

.thread-box {
  background: var(--white, #ffffff);
  border: 1px solid var(--border, #e8ecf4);
  border-radius: var(--radius-lg, 18px);
  padding: 36px;
  box-shadow: var(--shadow-sm, 0 4px 20px rgba(22,34,64,.06));
}

.thread-message {
  padding: 22px 0;
  border-bottom: 1px solid var(--border, #e8ecf4);
}

.thread-message:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.thread-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.thread-author {
  font-weight: 700;
  font-size: .9rem;
  color: var(--navy, #1d2b4f);
}

.thread-date {
  font-size: .78rem;
  color: var(--muted, #6b7a99);
  letter-spacing: .02em;
}

.thread-body {
  font-size: .9rem;
  line-height: 1.75;
  color: #444;
}

/* Evidenzia risposta admin */
.thread-message.admin {
  background: var(--bg, #f5f7fc);
  border: 1px solid var(--border, #e8ecf4);
  border-radius: var(--radius-md, 12px);
  padding: 22px 24px;
  margin-top: 4px;
}

.thread-message.admin .thread-author {
  color: var(--blue, #2253a0);
}


/* =========================
   REPLY BOX
========================= */

.reply-box {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border, #e8ecf4);
}

.reply-box textarea {
  width: 100%;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--border, #e8ecf4);
  padding: 16px;
  font-size: .9rem;
  font-family: inherit;
  background: var(--bg, #f5f7fc);
  transition: border-color .2s, box-shadow .2s;
}

.reply-box textarea:focus {
  outline: none;
  border-color: var(--blue, #2253a0);
  box-shadow: 0 0 0 3px rgba(34,83,160,.1);
  background: #fff;
}

.reply-box button {
  margin-top: 12px;
  background: var(--navy, #1d2b4f);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--radius-pill, 50px);
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: background .2s;
}

.reply-box button:hover {
  background: var(--blue, #2253a0);
}


/* =========================
   ADMIN TABLE
========================= */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  font-size: .875rem;
}

.admin-table th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted, #6b7a99);
  border-bottom: 2px solid var(--border, #e8ecf4);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #e8ecf4);
  color: #444;
}

.admin-table tr:hover td {
  background: var(--bg, #f5f7fc);
}


/* =========================
   STATUS
========================= */

.status {
  padding: 5px 12px;
  border-radius: var(--radius-sm, 8px);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  display: inline-block;
}

.status.aperto {
  background: #e6f7ec;
  color: #2e7d32;
}

.status.chiuso {
  background: #fdecea;
  color: #c62828;
}

.status.in-attesa {
  background: #fff8e1;
  color: #f57f17;
}


/* =========================
   BOTTONI
========================= */

.btn {
  padding: 9px 18px;
  border-radius: var(--radius-pill, 50px);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: background .2s, transform .15s, opacity .2s;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: .92;
}

.btn-primary {
  background: var(--navy, #1d2b4f);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue, #2253a0);
  opacity: 1;
}

.btn-secondary {
  background: var(--bg, #f5f7fc);
  color: var(--navy, #1d2b4f);
  border: 1px solid var(--border, #e8ecf4);
}

.btn-secondary:hover {
  background: var(--border, #e8ecf4);
  opacity: 1;
}

.btn-view {
  background: var(--navy, #1d2b4f);
  color: #fff;
}

.btn-delete {
  background: var(--bg, #f5f7fc);
  color: var(--muted, #6b7a99);
  margin-left: 6px;
  border: 1px solid var(--border, #e8ecf4);
}

.btn-back {
  background: var(--bg, #f5f7fc);
  color: var(--navy, #1d2b4f);
  border: 1px solid var(--border, #e8ecf4);
}


/* =========================
   ADMIN BAR
========================= */

.admin-bar {
  background: var(--navy, #1d2b4f);
  color: rgba(255,255,255,.8);
  padding: 12px 18px;
  border-radius: var(--radius-md, 12px);
  margin-bottom: 18px;
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-bar strong {
  color: var(--light, #6fa3e8);
}


/* =========================
   HOME HELPDESK — GRID CARDS
========================= */

.helpdesk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 0;
}

.helpdesk-card {
  background: var(--white, #ffffff);
  border: 1px solid var(--border, #e8ecf4);
  border-radius: var(--radius-lg, 18px);
  padding: 36px 32px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: box-shadow .25s, border-color .25s, transform .25s;
}

.helpdesk-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--navy, #1d2b4f), var(--light, #6fa3e8));
  opacity: 0;
  transition: opacity .25s;
}

.helpdesk-card:hover {
  box-shadow: var(--shadow-md, 0 12px 40px rgba(22,34,64,.12));
  border-color: rgba(34,83,160,.25);
  transform: translateY(-4px);
}

.helpdesk-card:hover::before {
  opacity: 1;
}

/* Icona card */
.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md, 12px);
  background: var(--bg, #f5f7fc);
  border: 1px solid var(--border, #e8ecf4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  color: var(--blue, #2253a0);
  font-size: 1.35rem;
  transition: background .25s, border-color .25s;
}

.helpdesk-card:hover .card-icon {
  background: rgba(34,83,160,.08);
  border-color: rgba(34,83,160,.2);
}

.helpdesk-card h3 {
  margin-bottom: 10px;
  color: var(--navy, #1d2b4f);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -.02em;
}

.helpdesk-card p {
  margin-bottom: 24px;
  color: var(--muted, #6b7a99);
  font-size: .9rem;
  line-height: 1.75;
}

/* Info strip sotto le cards */
.helpdesk-info-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border, #e8ecf4);
}

.info-strip-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.info-strip-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm, 8px);
  background: var(--bg, #f5f7fc);
  border: 1px solid var(--border, #e8ecf4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue, #2253a0);
  font-size: 1rem;
  flex-shrink: 0;
}

.info-strip-text strong {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: var(--navy, #1d2b4f);
  margin-bottom: 3px;
}

.info-strip-text span {
  font-size: .8rem;
  color: var(--muted, #6b7a99);
  line-height: 1.5;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1024px) {
  .helpdesk-container {
    padding: 0 36px;
  }
}

@media (max-width: 768px) {
  .helpdesk-container {
    padding: 0 20px;
    margin: 48px auto;
  }

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

  .helpdesk-info-strip {
    grid-template-columns: 1fr;
  }

  .admin-table {
    font-size: .8rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 12px;
  }

  .thread-box {
    padding: 22px;
  }
}
