.app-shell {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: #fafafa;
  color: #1f1f1f;
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
}

.sidebar {
  background: #ffffff;
  padding: 24px 20px;
  border-right: 1px solid #e6e6e6;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #cc0000;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
}
.brand-title { font-weight: 800; letter-spacing: 0.4px; color: #cc0000; }
.brand-sub { font-size: 12px; color: #666; }

.nav { display: flex; flex-direction: column; gap: 8px; }
.nav-link {
  border: 1px solid transparent;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  background: transparent;
  color: #333;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-link:hover { background: #f6f6f6; color: #cc0000; }
.nav-link.active { border-color: #cc0000; color: #cc0000; background: #ffecec; }
.logout-link { margin-top: 8px; color: #b30000; }

.content {
  padding: 28px 32px 60px;
  background: #fafafa;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.eyebrow { text-transform: uppercase; letter-spacing: 1px; font-size: 12px; color: #7a7a7a; margin: 0; }
h1 { margin: 6px 0 4px; font-size: 28px; color: #111; }
.hint { color: #666; font-size: 14px; }

.pill-select-wrap { display: grid; gap: 8px; align-items: start; }
.pill-label { font-size: 12px; color: #7a7a7a; }
.pill-select {
  background: #fff;
  border: 1px solid #e0e0e0;
  color: #111;
  padding: 10px 12px;
  border-radius: 10px;
}
.pill-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-ghost, .btn-accent, .btn-danger {
  border: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.btn-small { padding: 6px 10px; font-size: 12px; }
.btn-ghost {
  background: #f3f3f3;
  color: #1f1f1f;
  border: 1px solid #e3e3e3;
}
.btn-ghost:hover { background: #e8e8e8; }
.btn-accent {
  background: #cc0000;
  color: #fff;
  box-shadow: 0 6px 18px rgba(204,0,0,0.22);
}
.btn-accent:hover { background: #b30000; }
.btn-danger { background: #e53935; color: #fff; }

.section { display: none; }
.section.active { display: block; }

.cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 16px; margin-bottom: 18px; }
.card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.card.stat { min-height: 120px; }
.stat-label { color: #7a7a7a; font-size: 13px; }
.stat-value { font-size: 26px; font-weight: 800; color: #cc0000; margin-top: 6px; }
.stat-hint { font-size: 12px; color: #8a8a8a; }

.panel {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.03);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel h3 { margin: 4px 0; color: #111; }
.eyebrow { margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 12px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #ebebeb;
  background: #fff;
}
.list-title { font-weight: 700; color: #111; }
.small { font-size: 13px; color: #555; }

.form-grid { display: grid; gap: 10px; }
.form-grid.compact { gap: 8px; }
.input, textarea.input, select.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #111;
}
.input:focus { outline: 1px solid #cc0000; }
label { font-size: 13px; color: #333; display: grid; gap: 6px; }
.actions-end { display: flex; justify-content: flex-end; margin-top: 6px; }
.hint { color: #7a7a7a; font-size: 13px; }

.placeholder { text-align: left; }
.placeholder h3 { margin-bottom: 8px; }
.placeholder p { color: #666; }

.toast-bar {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: #cc0000;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  border: 1px solid #b30000;
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .content { padding: 20px; }
  .topbar { flex-direction: column; }
}

.login-shell {
  margin: 0;
  min-height: 100vh;
  background: #fafafa;
  display: grid;
  place-items: center;
  color: #1f1f1f;
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
}
.login-card {
  width: min(420px, 92vw);
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #e6e6e6;
  background: #f5f5f5;
  color: #444;
}
.tag.red { background: #ffecec; border-color: #ffcccc; color: #b30000; }
.tag.green { background: #e6f4ea; border-color: #c8e6d0; color: #1b5e20; }
.tag.amber { background: #fff7e0; border-color: #ffe2a8; color: #c77c02; }
.tag.gray { background: #f1f1f1; border-color: #dedede; color: #555; }

.status-aperta { background: #fff7e0; border-color: #ffe0a3; color: #c06a00; }
.status-in_acquisto { background: #e6f4ea; border-color: #cce7d3; color: #1b5e20; }
.status-chiusa { background: #e8e8e8; border-color: #d6d6d6; color: #333; }
.status-annullata { background: #ffecec; border-color: #ffcccc; color: #b30000; }

.status-confermato { background: #e6f4ea; border-color: #cce7d3; color: #1b5e20; }
.status-pendente { background: #fff7e0; border-color: #ffe0a3; color: #c06a00; }
.status-annullato { background: #ffecec; border-color: #ffcccc; color: #b30000; }

.conflict {
  border-color: #ffb2b2 !important;
  background: #fff2f2;
}

select[multiple].input {
  min-height: 90px;
}
