/* Reset e base */
* {
  box-sizing: border-box;
}
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f7fa;
  color: #333;
}
.container {
  max-width: 960px;
  margin: 30px auto;
  background: white;
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

/* Form base */
form label {
  display: block;
  margin-top: 15px;
  font-weight: bold;
}
form input[type="text"],
form input[type="email"],
form select,
form textarea,
form input[type="file"] {
  width: 100%;
  padding: 8px 10px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 15px;
  transition: border-color 0.3s;
}
form input[type="text"]:focus,
form input[type="email"]:focus,
form select:focus,
form textarea:focus {
  border-color: #2980b9;
  outline: none;
}
form textarea {
  min-height: 100px;
  resize: vertical;
}
button {
  margin-top: 20px;
  background-color: #2980b9;
  border: none;
  color: white;
  padding: 12px 25px;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}
button:hover {
  background-color: #3498db;
}

/* Messaggi */
.error {
  background-color: #e74c3c;
  color: white;
  padding: 12px 20px;
  border-radius: 5px;
  margin-bottom: 15px;
}
.success {
  background-color: #27ae60;
  color: white;
  padding: 12px 20px;
  border-radius: 5px;
  margin-bottom: 15px;
}

/* Backend layout: container flex per menu e main */
.container-flex {
  display: flex;
  min-height: 80vh;
}

/* Menu verticale */
nav {
  width: 220px;
  background-color: #2c3e50;
  color: white;
  padding: 20px;
  box-sizing: border-box;
  border-radius: 6px 0 0 6px;
}
nav h3 {
  margin: 0 0 20px;
  font-weight: normal;
  font-size: 18px;
}
nav ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
nav ul li {
  margin-bottom: 12px;
}
nav ul li a {
  color: #ecf0f1;
  text-decoration: none;
  font-weight: bold;
  display: block;
  padding: 10px 15px;
  border-radius: 4px;
  transition: background-color 0.3s;
}
nav ul li a:hover,
nav ul li a.active {
  background-color: #2980b9;
}

/* Logout */
.logout {
  display: block;
  margin-top: 30px;
  font-weight: bold;
  color: #ecf0f1;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 4px;
  transition: background-color 0.3s;
}
.logout:hover {
  background-color: #c0392b;
}

/* Contenuto principale */
main {
  flex-grow: 1;
  background: white;
  padding: 20px;
  border-radius: 0 6px 6px 0;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.05);
  overflow-y: auto;
}

/* Tabelle */
table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 15px;
}
table th, table td {
  border: 1px solid #ddd;
  padding: 12px 10px;
  vertical-align: top;
  font-size: 14px;
}
table th {
  background-color: #3498db;
  color: white;
  text-align: left;
}

/* Dettagli risposte */
details > summary {
  cursor: pointer;
  font-weight: bold;
  margin-bottom: 8px;
}

/* Textarea per risposta backend */
textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  margin-top: 6px;
}

/* Pulsanti inline */
button {
  margin-top: 8px;
}

/* Scroll scrollbar custom */
main::-webkit-scrollbar {
  width: 8px;
}
main::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.1);
  border-radius: 4px;
}

/* Responsive */
@media(max-width: 768px) {
  .container-flex {
    flex-direction: column;
  }
  nav {
    width: 100%;
    border-radius: 6px 6px 0 0;
  }
  main {
    border-radius: 0 0 6px 6px;
  }
}

/* Menu verticale a sinistra per backend */
.container-flex {
  display: flex;
  min-height: 100vh;
  background: #f9f9f9;
}

nav {
  width: 220px;
  background: #004080;
  color: white;
  padding: 20px;
  box-sizing: border-box;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

nav h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-weight: 700;
  font-size: 1.4em;
  border-bottom: 1px solid #1a75ff;
  padding-bottom: 8px;
}

nav ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  flex-grow: 1;
}

nav ul li {
  margin-bottom: 12px;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 8px;
  display: block;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
  background-color: #1a75ff;
}

nav a.logout {
  color: #ffdddd;
  font-weight: 700;
  margin-top: 20px;
  display: block;
  text-align: center;
  border: 1px solid #ff4d4d;
  padding: 8px 0;
  border-radius: 6px;
  background-color: #cc0000;
  transition: background-color 0.3s ease;
}

nav a.logout:hover {
  background-color: #e60000;
  color: white;
}

main {
  flex-grow: 1;
  padding: 30px 40px;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Ticket box */
.ticket-box {
  border: 1px solid #ccc;
  background: white;
  padding: 15px 20px;
  border-radius: 6px;
  margin-bottom: 25px;
  box-shadow: 0 0 8px rgba(0,0,0,0.05);
}

.ticket-box strong {
  color: #004080;
}

.ticket-box pre {
  background: #f0f0f0;
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
  white-space: pre-wrap;
}

.ticket-box details summary {
  cursor: pointer;
  font-weight: 600;
  color: #004080;
  margin-top: 10px;
}

.ticket-box details div {
  margin-top: 8px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.ticket-box form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1em;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
  margin-bottom: 10px;
}

.ticket-box form button {
  background-color: #004080;
  color: white;
  border: none;
  padding: 10px 20px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.ticket-box form button:hover {
  background-color: #0066cc;
}

.ticket-box form label {
  display: inline-block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #003366;
}

.ticket-box form select {
  padding: 6px 10px;
  margin-right: 12px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 1em;
}

.success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-weight: 600;
}

.btn-home {
  display: inline-block;
  background-color: #004080;
  color: #fff;
  text-decoration: none;
  padding: 15px 25px;
  margin: 10px;
  border-radius: 8px;
  font-size: 18px;
  transition: background-color 0.3s ease;
}

.btn-home:hover {
  background-color: #0066cc;
}

.logo-container {
  padding: 15px;
  text-align: center;
  border-bottom: 1px solid #ccc;
  margin-bottom: 15px;
}



