:root {
  --card: rgba(255, 255, 255, 0.92);
  --border: rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f6f8fb;
}

.bg {
  position: fixed;
  inset: 0;
  background: url("/static/img/bg_hospital.png") center/cover no-repeat;
  opacity: 0.35;          /* sfondo "appena visibile" */
  pointer-events: none;
  filter: blur(0px);
}

/* TOP BAR (SCURA per logo bianco trasparente) */
.topbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;

  /* barra più stretta */
  padding: 6px 14px;
  height: 72px;
  box-sizing: border-box;
  overflow: hidden;

  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 10;
}

/* IMPORTANTISSIMO: il logo da 168px sta forzando l'altezza della barra.
   Lo “stringiamo” SOLO quando è dentro la topbar. */
.topbar .logo {
  width: auto;
  height: 56px;      /* cambia qui: 48/56/64 a gusto */
  object-fit: contain;
  display: block;
}

/* opzionale: stringe anche la parte testo */
.topbar .brand-title { line-height: 1; }
.topbar .brand-sub { line-height: 1; }


.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 168px;
  height: 168px;
  object-fit: contain;
}

.brand-text { display: flex; flex-direction: column; }

.brand-title {
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.brand-sub {
  font-size: 12px;
  opacity: 0.75;
  color: #fff;
}

/* Layout */
.container {
  padding: 22px;
  max-width: 980px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--border);
  text-decoration: none;
  color: #111;
  transition: transform 0.08s ease;
}

.tile:hover { transform: translateY(-1px); }

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

input, textarea {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
}

.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  background: #111;
  color: white;
  cursor: pointer;
}

.btn:hover { opacity: 0.95; }

.btn.ghost {
  background: transparent;
  color: #111;
  border: 1px solid var(--border);
}

/* Ghost button in topbar should be white */
.topbar .btn.ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.topbar .btn.ghost:hover {
  border-color: rgba(255, 255, 255, 0.45);
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.code {
  background: rgba(0, 0, 0, 0.03);
  padding: 12px;
  border-radius: 12px;
  overflow: auto;
}

.err { color: #b00020; }

.hint {
  font-size: 12px;
  opacity: 0.7;
}

.dq-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
}

.dq-steps ol {
  padding-left: 18px;
}

.dq-steps li {
  margin: 8px 0;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.7);
}

.dq-steps li.active {
  border-color: rgba(0,0,0,0.18);
  font-weight: 700;
}

.dq-meta {
  font-size: 12px;
  opacity: 0.85;
  margin: 12px 0;
  display: grid;
  gap: 6px;
}

.dq-grid { display: grid; gap: 12px; }

.dq-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
}

.dq-table th, .dq-table td {
  padding: 8px;
  border-top: 1px solid rgba(0,0,0,0.08);
  text-align: left;
  font-size: 13px;
}

.dq-table th { background: rgba(0,0,0,0.04); }

.dq-loading{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.dq-loading-box{
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
}

.dq-spinner{
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid rgba(0,0,0,.15);
  border-top-color: rgba(0,0,0,.6);
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

